summaryrefslogtreecommitdiff
path: root/lib/human.c
diff options
context:
space:
mode:
authorJim Meyering <jim@meyering.net>2005-04-09 12:35:41 +0000
committerJim Meyering <jim@meyering.net>2005-04-09 12:35:41 +0000
commit89e0ab6c9e3e7fd5e5cc774580457a980dfa0e40 (patch)
tree4778e83b0e0393268a448593b06020e60c59bcf3 /lib/human.c
parent56e6bb413fd4f7c08e5aaf071e6a9a60fe9cf50f (diff)
downloadcoreutils-89e0ab6c9e3e7fd5e5cc774580457a980dfa0e40.tar.xz
(humblock): Set *options even when returning due to
xstrtoumax conversion failure. Thanks to a used-uninitialized warning from gcc-4.
Diffstat (limited to 'lib/human.c')
-rw-r--r--lib/human.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/human.c b/lib/human.c
index 79336624a..1e8a59033 100644
--- a/lib/human.c
+++ b/lib/human.c
@@ -451,7 +451,10 @@ humblock (char const *spec, uintmax_t *block_size, int *options)
strtol_error e = xstrtoumax (spec, &ptr, 0, block_size,
"eEgGkKmMpPtTyYzZ0");
if (e != LONGINT_OK)
- return e;
+ {
+ *options = 0;
+ return e;
+ }
for (; ! ('0' <= *spec && *spec <= '9'); spec++)
if (spec == ptr)
{