qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [6215] snapshot subcommand for qemu-img (Kevin Wolf)


From: M. Warner Losh
Subject: Re: [Qemu-devel] [6215] snapshot subcommand for qemu-img (Kevin Wolf)
Date: Tue, 13 Jan 2009 13:36:33 -0700 (MST)

In message: <address@hidden>
            Anthony Liguori <address@hidden> writes:
: 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?

More importantly, getopt returns an 'int' not a 'signed char'.  This
means it can report values that can't be represented by a 'signed
char'.

Warner




reply via email to

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