diff options
author | Richard Jones <rjones@redhat.com> | 2009-11-04 18:03:58 +0000 |
---|---|---|
committer | Richard Jones <rjones@redhat.com> | 2009-11-04 18:03:58 +0000 |
commit | 3266e51054fdc1f584bd7a8611c7706e6d0b7cef (patch) | |
tree | 93639c2e10dde66689b0a4610eb4dab558218439 /fish/alloc.c | |
parent | 5ce72e039ca332ba19bb9122b7c93d257e745bb5 (diff) | |
download | libguestfs-3266e51054fdc1f584bd7a8611c7706e6d0b7cef.tar.gz libguestfs-3266e51054fdc1f584bd7a8611c7706e6d0b7cef.tar.xz libguestfs-3266e51054fdc1f584bd7a8611c7706e6d0b7cef.zip |
fish: Allow <nn>T for terabyte allocations.
Diffstat (limited to 'fish/alloc.c')
-rw-r--r-- | fish/alloc.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/fish/alloc.c b/fish/alloc.c index e35c02f7..3b0de27e 100644 --- a/fish/alloc.c +++ b/fish/alloc.c @@ -140,9 +140,10 @@ parse_size (const char *str, off_t *size_rtn) */ if (sscanf (str, "%"SCNu64"%c", &size, &type) == 2) { switch (type) { - case 'k': case 'K': size *= 1024; break; - case 'm': case 'M': size *= 1024 * 1024; break; - case 'g': case 'G': size *= 1024 * 1024 * 1024; break; + case 'k': case 'K': size *= 1024L; break; + case 'm': case 'M': size *= 1024L * 1024; break; + case 'g': case 'G': size *= 1024L * 1024 * 1024; break; + case 't': case 'T': size *= 1024L * 1024 * 1024 * 1024; break; case 's': size *= 512; break; default: fprintf (stderr, _("could not parse size specification '%s'\n"), str); |