[Libguestfs] [PATCH] Bugfix in number parsing in vfs_min_size.

Maxim Perevedentsev mperevedentsev at virtuozzo.com
Thu Oct 22 17:04:32 UTC 2015


---
The number changed means base (radix) of numbers parsed.

 daemon/ext2.c | 2 +-
 daemon/ntfs.c | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/daemon/ext2.c b/daemon/ext2.c
index 342d217..6543574 100644
--- a/daemon/ext2.c
+++ b/daemon/ext2.c
@@ -336,7 +336,7 @@ ext_minimum_size (const char *device)
   for (i = 0; lines[i] != NULL; ++i) {
     if (STRPREFIX (lines[i], pattern)) {
       if (XSTRTOD64 (lines[i] + strlen (pattern),
-                     NULL, 20, &ret, NULL) != LONGINT_OK) {
+                     NULL, 10, &ret, NULL) != LONGINT_OK) {
         reply_with_error ("cannot parse minimum size");
         return -1;
       }
diff --git a/daemon/ntfs.c b/daemon/ntfs.c
index ea0844f..8e1aa5a 100644
--- a/daemon/ntfs.c
+++ b/daemon/ntfs.c
@@ -201,7 +201,7 @@ ntfs_minimum_size (const char *device)
       }
       else if (STRPREFIX (lines[i], volume_size_pattern)) {
         if (XSTRTOD64 (lines[i] + strlen (volume_size_pattern),
-                       NULL, 20, &volume_size, NULL) != LONGINT_OK) {
+                       NULL, 10, &volume_size, NULL) != LONGINT_OK) {
           reply_with_error ("cannot parse volume size");
           return -1;
         }
@@ -226,7 +226,7 @@ ntfs_minimum_size (const char *device)
     if (STRPREFIX (lines[i], size_pattern)) {
       int64_t ret;
       if (XSTRTOD64 (lines[i] + strlen (size_pattern),
-                     NULL, 20, &ret, NULL) != LONGINT_OK) {
+                     NULL, 10, &ret, NULL) != LONGINT_OK) {
         reply_with_error ("cannot parse minimum size");
         return -1;
       }
--
1.8.3.1




More information about the Libguestfs mailing list