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

[Libguestfs] [PATCH] guestfish: Use xstrtoll to parse Int params (RHBZ#569757 RHBZ#567567).



Fix for the two bugs noted in $SUBJECT.

Rich.

-- 
Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones
libguestfs lets you edit virtual machines.  Supports shell scripting,
bindings from many languages.  http://et.redhat.com/~rjones/libguestfs/
See what it can do: http://et.redhat.com/~rjones/libguestfs/recipes.html
>From fffb60bbbb5a06703ec787a857e1be7ad023a7e6 Mon Sep 17 00:00:00 2001
From: Richard Jones <rjones redhat com>
Date: Fri, 12 Mar 2010 09:47:38 +0000
Subject: [PATCH] guestfish: Use xstrtoll to parse Int params (RHBZ#569757 RHBZ#567567).

Change guestfish so it uses xstrtoll to parse Int (31 bit)
parameters.  This fixes two bugs on 32 bit platforms which
failed when long = 32 bits.  long long = 64 bits on both.
---
 regressions/rhbz557655-expected.stderr |    8 ++++----
 src/generator.ml                       |    2 +-
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/regressions/rhbz557655-expected.stderr b/regressions/rhbz557655-expected.stderr
index ea560e8..c8e02f5 100644
--- a/regressions/rhbz557655-expected.stderr
+++ b/regressions/rhbz557655-expected.stderr
@@ -2,10 +2,10 @@ set-memsize: memsize: integer out of range
 set-memsize: memsize: integer out of range
 set-memsize: memsize: integer out of range
 set-memsize: memsize: integer out of range
-set-memsize: memsize: invalid integer parameter (xstrtol returned 4)
-set-memsize: memsize: invalid integer parameter (xstrtol returned 2)
-set-memsize: memsize: invalid integer parameter (xstrtol returned 2)
-set-memsize: memsize: invalid integer parameter (xstrtol returned 2)
+set-memsize: memsize: invalid integer parameter (xstrtoll returned 4)
+set-memsize: memsize: invalid integer parameter (xstrtoll returned 2)
+set-memsize: memsize: invalid integer parameter (xstrtoll returned 2)
+set-memsize: memsize: invalid integer parameter (xstrtoll returned 2)
 libguestfs: error: truncate_size: ftruncate: /test: File too large
 truncate-size: size: invalid integer parameter (xstrtoll returned 1)
 truncate-size: size: invalid integer parameter (xstrtoll returned 4)
diff --git a/src/generator.ml b/src/generator.ml
index 96b5b70..fab2173 100755
--- a/src/generator.ml
+++ b/src/generator.ml
@@ -7221,7 +7221,7 @@ and generate_fish_cmds () =
                 and comment =
                   "The Int type in the generator is a signed 31 bit int." in
                 Some (min, max, comment) in
-              parse_integer "xstrtol" "long" "int" range name i
+              parse_integer "xstrtoll" "long long" "int" range name i
           | Int64 name ->
               parse_integer "xstrtoll" "long long" "int64_t" None name i
       ) (snd style);
-- 
1.7.0.1


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