From patchwork Fri Mar 11 20:43:18 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sakari Ailus X-Patchwork-Id: 8568981 Return-Path: X-Original-To: patchwork-linux-media@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 6D7A8C0553 for ; Fri, 11 Mar 2016 20:45:43 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 98C352034A for ; Fri, 11 Mar 2016 20:45:42 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id C8A7220340 for ; Fri, 11 Mar 2016 20:45:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751578AbcCKUph (ORCPT ); Fri, 11 Mar 2016 15:45:37 -0500 Received: from mga14.intel.com ([192.55.52.115]:38903 "EHLO mga14.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750953AbcCKUph (ORCPT ); Fri, 11 Mar 2016 15:45:37 -0500 Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga103.fm.intel.com with ESMTP; 11 Mar 2016 12:45:36 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.24,321,1455004800"; d="scan'208";a="908293820" Received: from paasikivi.fi.intel.com ([10.237.72.42]) by orsmga001.jf.intel.com with ESMTP; 11 Mar 2016 12:45:35 -0800 Received: from nauris.fi.intel.com (nauris.localdomain [192.168.240.2]) by paasikivi.fi.intel.com (Postfix) with ESMTP id C5C59201A6; Fri, 11 Mar 2016 22:45:33 +0200 (EET) Received: by nauris.fi.intel.com (Postfix, from userid 1000) id 9363920109; Fri, 11 Mar 2016 22:43:18 +0200 (EET) From: Sakari Ailus To: linux-media@vger.kernel.org Cc: laurent.pinchart@ideasonboard.com Subject: [v4l-utils PATCH 1/1] libv4l2subdev: Allow extra spaces between format strings Date: Fri, 11 Mar 2016 22:43:18 +0200 Message-Id: <1457728998-11906-1-git-send-email-sakari.ailus@linux.intel.com> X-Mailer: git-send-email 2.1.0.231.g7484e3b Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP It's possible to pass more than one format string (and entity) to v4l2_subdev_parse_setup_formats(), yet v4l2_subdev_parse_pad_format() does not parse the string until the next non-space character. v4l2_subdev_parse_setup_formats() expects to find a comma right after that leading spaces before the comma to produce an error. Seek until no spaces are seen. Signed-off-by: Sakari Ailus Acked-by: Laurent Pinchart --- utils/media-ctl/libv4l2subdev.c | 1 + 1 file changed, 1 insertion(+) diff --git a/utils/media-ctl/libv4l2subdev.c b/utils/media-ctl/libv4l2subdev.c index 1f5fca4..3dcf943 100644 --- a/utils/media-ctl/libv4l2subdev.c +++ b/utils/media-ctl/libv4l2subdev.c @@ -723,6 +723,7 @@ int v4l2_subdev_parse_setup_formats(struct media_device *media, const char *p) if (ret < 0) return ret; + for (; isspace(*end); end++); p = end + 1; } while (*end == ',');