qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] Re: [PATCH 3/3] Fail if detecting an unknown option


From: Jes Sorensen
Subject: [Qemu-devel] Re: [PATCH 3/3] Fail if detecting an unknown option
Date: Mon, 06 Dec 2010 09:02:05 +0100
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.12) Gecko/20101103 Fedora/1.0-0.33.b2pre.fc14 Lightning/1.0b3pre Thunderbird/3.1.6

On 12/03/10 13:30, Kevin Wolf wrote:
> Am 02.12.2010 18:46, schrieb address@hidden:
>> diff --git a/qemu-img.c b/qemu-img.c
>> index d0dc445..f2e1c94 100644
>> --- a/qemu-img.c
>> +++ b/qemu-img.c
>> @@ -304,6 +304,12 @@ static int img_create(int argc, char **argv)
>>      flags = 0;
>>      for(;;) {
>>          c = getopt(argc, argv, "F:b:f:he6o:");
>> +        /*
>> +         * Fail if we detect an unknown argument
>> +         */
>> +        if (c == '?') {
>> +            return 1;
>> +        }
>>          if (c == -1) {
>>              break;
>>          }
> 
> Why not making it another case in the switch statement below instead of
> an additional if?

There is a perfectly logical explanation for that. Doing that would
require for me to have clue, which is a bit much to expect :)

That said, we should really do the same for the c == -1 case as well.

Fixed in next version.

Cheers,
Jes



reply via email to

[Prev in Thread] Current Thread [Next in Thread]