qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "M. Warner Losh" <imp@bsdimp.com>
To: qemu-devel@nongnu.org, anthony@codemonkey.ws
Cc: kwolf@suse.de
Subject: Re: [Qemu-devel] [6215] snapshot subcommand for qemu-img (Kevin Wolf)
Date: Tue, 13 Jan 2009 13:36:33 -0700 (MST)	[thread overview]
Message-ID: <20090113.133633.1649829323.imp@bsdimp.com> (raw)
In-Reply-To: <496CE528.5090509@codemonkey.ws>

In message: <496CE528.5090509@codemonkey.ws>
            Anthony Liguori <anthony@codemonkey.ws> 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	other threads:[~2009-01-13 20:39 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-01-07 17:40 [Qemu-devel] [6215] snapshot subcommand for qemu-img (Kevin Wolf) Anthony Liguori
2009-01-13 19:02 ` Anthony Liguori
2009-01-13 20:36   ` M. Warner Losh [this message]
2009-01-14  8:55   ` [Qemu-devel] [PATCH] qemu-img: Fix type of getopt return value Kevin Wolf
2009-01-15 21:42     ` [Qemu-devel] " Anthony Liguori

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20090113.133633.1649829323.imp@bsdimp.com \
    --to=imp@bsdimp.com \
    --cc=anthony@codemonkey.ws \
    --cc=kwolf@suse.de \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).