From patchwork Fri Jul 22 11:42:17 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christophe Fergeau X-Patchwork-Id: 106265 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [140.186.70.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id EABB7B6F71 for ; Fri, 22 Jul 2011 21:43:13 +1000 (EST) Received: from localhost ([::1]:33417 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QkE8L-0004BT-Mn for incoming@patchwork.ozlabs.org; Fri, 22 Jul 2011 07:43:09 -0400 Received: from eggs.gnu.org ([140.186.70.92]:47609) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QkE7g-0002PS-11 for qemu-devel@nongnu.org; Fri, 22 Jul 2011 07:42:28 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QkE7e-0002UY-RN for qemu-devel@nongnu.org; Fri, 22 Jul 2011 07:42:27 -0400 Received: from mx1.redhat.com ([209.132.183.28]:41901) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QkE7e-0002UP-Jp for qemu-devel@nongnu.org; Fri, 22 Jul 2011 07:42:26 -0400 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id p6MBgPBZ005687 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Fri, 22 Jul 2011 07:42:25 -0400 Received: from localhost.localdomain (ovpn-116-27.ams2.redhat.com [10.36.116.27]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id p6MBgLs9007979 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Fri, 22 Jul 2011 07:42:25 -0400 From: Christophe Fergeau To: qemu-devel@nongnu.org Date: Fri, 22 Jul 2011 13:42:17 +0200 Message-Id: <1311334940-29362-2-git-send-email-cfergeau@redhat.com> In-Reply-To: <1311334940-29362-1-git-send-email-cfergeau@redhat.com> References: <1311334940-29362-1-git-send-email-cfergeau@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.22 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCHv4 1/4] libcacard: s/strip(args++)/strip(args+1) X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org vcard_emul_options used args = strip(args++) a few times, which was not returning the expected result since the rest of the code expected args to be increased by at least 1, which is not the case if *args is not a blank space when this function is called. Replace these calls by "strip(args+1)" which will do what we expect. Signed-off-by: Christophe Fergeau Reviewed-by: Alon Levy --- libcacard/vcard_emul_nss.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/libcacard/vcard_emul_nss.c b/libcacard/vcard_emul_nss.c index f3db657..184252f 100644 --- a/libcacard/vcard_emul_nss.c +++ b/libcacard/vcard_emul_nss.c @@ -1041,7 +1041,7 @@ vcard_emul_options(const char *args) args++; continue; } - args = strip(args++); + args = strip(args+1); type_params = args; args = strpbrk(args + 1, ",)"); if (*args == 0) { @@ -1052,7 +1052,7 @@ vcard_emul_options(const char *args) continue; } type_params_length = args - name; - args = strip(args++); + args = strip(args+1); if (*args == 0) { break; }