From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LNZz2-0007yS-45 for qemu-devel@nongnu.org; Thu, 15 Jan 2009 16:42:36 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LNZz0-0007wH-D8 for qemu-devel@nongnu.org; Thu, 15 Jan 2009 16:42:35 -0500 Received: from [199.232.76.173] (port=37502 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LNZz0-0007w2-2j for qemu-devel@nongnu.org; Thu, 15 Jan 2009 16:42:34 -0500 Received: from mail-qy0-f20.google.com ([209.85.221.20]:38857) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1LNZyz-0000aG-Pr for qemu-devel@nongnu.org; Thu, 15 Jan 2009 16:42:33 -0500 Received: by qyk13 with SMTP id 13so1961364qyk.10 for ; Thu, 15 Jan 2009 13:42:32 -0800 (PST) Message-ID: <496FADBE.4080403@codemonkey.ws> Date: Thu, 15 Jan 2009 15:42:22 -0600 From: Anthony Liguori MIME-Version: 1.0 References: <496CE528.5090509@codemonkey.ws> <496DA86F.40400@suse.de> In-Reply-To: <496DA86F.40400@suse.de> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Subject: [Qemu-devel] Re: [PATCH] qemu-img: Fix type of getopt return value Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Kevin Wolf Cc: qemu-devel@nongnu.org Kevin Wolf wrote: > Anthony Liguori schrieb: > >> Anthony Liguori wrote: >> >>> +static void img_snapshot(int argc, char **argv) >>> +{ >>> + BlockDriverState *bs; >>> + QEMUSnapshotInfo sn; >>> + char *filename, *snapshot_name = NULL; >>> + char c; >>> + int ret; >>> + int action = 0; >>> + qemu_timeval tv; >>> + >>> + /* Parse commandline parameters */ >>> + for(;;) { >>> + c = getopt(argc, argv, "la:c:d:h"); >>> + if (c == -1) >>> + break; >>> >>> >> char's are not always signed so this code is incorrect. You should use >> an int instead. Can you send another patch fixing this please? >> > > You're right. I better should have copied not only the parsing but also > the declarations... Patch is attached. > Applied. Thanks. Regards, Anthony Liguori > Kevin >