[Pkg-libvirt-commits] [libguestfs] 120/156: rescue: fix sscanf placeholders for --smp and --memsize
Hilko Bengen
bengen at moszumanska.debian.org
Sat Aug 30 08:26:12 UTC 2014
This is an automated email from the git hooks/post-receive script.
bengen pushed a commit to branch master
in repository libguestfs.
commit ab2c42acdb79e2caa8eab2691912e9784ef7e25e
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.
(cherry picked from commit d1f580550b32e8552ee64f12872b0fa10147957f)
---
rescue/rescue.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/rescue/rescue.c b/rescue/rescue.c
index d0c6207..7742ab9 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