Maxim Perevedentsev
2015-Oct-22 17:04 UTC
[Libguestfs] [PATCH] Bugfix in number parsing in vfs_min_size.
--- 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
Richard W.M. Jones
2015-Oct-23 09:06 UTC
Re: [Libguestfs] [PATCH] Bugfix in number parsing in vfs_min_size.
On Thu, Oct 22, 2015 at 08:04:32PM +0300, Maxim Perevedentsev wrote:> --- > 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; > }Thanks - applied. Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones Read my programming and virtualization blog: http://rwmj.wordpress.com virt-p2v converts physical machines to virtual machines. Boot with a live CD or over the network (PXE) and turn machines into KVM guests. http://libguestfs.org/virt-v2v
Seemingly Similar Threads
- [PATCHv3 0/2] Introduce vfs_min_size API to get minimum filesystem size.
- [PATCHv4 0/2] Introduce vfs_minimum_size API to get minimum filesystem size.
- [PATCHv3 1/2] New API: vfs_min_size
- Re: [PATCH 1/2] New API: vfs_min_size
- [PATCHv2 0/2] Introduce vfs_min_size API to get minimum filesystem size.