diff options
author | Jes Sorensen <Jes.Sorensen@redhat.com> | 2011-01-24 16:33:29 +0100 |
---|---|---|
committer | Kevin Wolf <kwolf@redhat.com> | 2011-01-31 10:03:00 +0100 |
commit | a2afc2c16339a85176696738e4c58ed4ff36f8b5 (patch) | |
tree | 0b0872741671b38abada59faa0caefbc0b931fd7 | |
parent | f3bd362a1857c617a4154062cadd501fc52c4199 (diff) |
strtosz() use qemu_toupper() to simplify switch statement
Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
-rw-r--r-- | cutils.c | 7 |
1 files changed, 1 insertions, 6 deletions
@@ -323,16 +323,14 @@ int64_t strtosz_suffix(const char *nptr, char **end, const char default_suffix) d = c; } } - switch (d) { + switch (qemu_toupper(d)) { case 'B': - case 'b': mul = 1; if (mul_required) { goto fail; } break; case 'K': - case 'k': mul = 1 << 10; break; case 0: @@ -340,15 +338,12 @@ int64_t strtosz_suffix(const char *nptr, char **end, const char default_suffix) goto fail; } case 'M': - case 'm': mul = 1ULL << 20; break; case 'G': - case 'g': mul = 1ULL << 30; break; case 'T': - case 't': mul = 1ULL << 40; break; default: |