aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJes Sorensen <Jes.Sorensen@redhat.com>2011-01-24 16:33:29 +0100
committerKevin Wolf <kwolf@redhat.com>2011-01-31 10:03:00 +0100
commita2afc2c16339a85176696738e4c58ed4ff36f8b5 (patch)
tree0b0872741671b38abada59faa0caefbc0b931fd7
parentf3bd362a1857c617a4154062cadd501fc52c4199 (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.c7
1 files changed, 1 insertions, 6 deletions
diff --git a/cutils.c b/cutils.c
index a067cf45b3..78d35e23ca 100644
--- a/cutils.c
+++ b/cutils.c
@@ -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: