[Libguestfs] [PATCH] Bugfix in number parsing in vfs_min_size.
Richard W.M. Jones
rjones at redhat.com
Fri Oct 23 09:06:34 UTC 2015
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
More information about the Libguestfs
mailing list