[Pkg-libvirt-commits] [libguestfs] 64/266: rescue: fix sscanf placeholders for --smp and --memsize

Hilko Bengen bengen at moszumanska.debian.org
Fri Oct 3 14:41:43 UTC 2014


This is an automated email from the git hooks/post-receive script.

bengen pushed a commit to annotated tag debian/1%1.27.35-1
in repository libguestfs.

commit d1f580550b32e8552ee64f12872b0fa10147957f
Author: Pino Toscano <ptoscano at redhat.com>
Date:   Fri Aug 8 10:23:37 2014 +0200

    rescue: fix sscanf placeholders for --smp and --memsize
    
    Use %d to parse them as int (since the variables for them as int)
    instead of %u, even if they both need to be at least > 0; the library
    will check for the validity of them anyway.
---
 rescue/rescue.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/rescue/rescue.c b/rescue/rescue.c
index dc56d4b..c73db55 100644
--- a/rescue/rescue.c
+++ b/rescue/rescue.c
@@ -157,7 +157,7 @@ main (int argc, char *argv[])
         else
           format = optarg;
       } else if (STREQ (long_options[option_index].name, "smp")) {
-        if (sscanf (optarg, "%u", &smp) != 1) {
+        if (sscanf (optarg, "%d", &smp) != 1) {
           fprintf (stderr, _("%s: could not parse --smp parameter '%s'\n"),
                    program_name, optarg);
           exit (EXIT_FAILURE);
@@ -208,7 +208,7 @@ main (int argc, char *argv[])
       break;
 
     case 'm':
-      if (sscanf (optarg, "%u", &memsize) != 1) {
+      if (sscanf (optarg, "%d", &memsize) != 1) {
         fprintf (stderr, _("%s: could not parse memory size '%s'\n"),
                  program_name, optarg);
         exit (EXIT_FAILURE);

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-libvirt/libguestfs.git



More information about the Pkg-libvirt-commits mailing list