From 9e7c3aa5dfbd79b7de55146cd85f5953f7e5f34b Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Sun, 27 Dec 2015 20:58:15 +0100 Subject: fix errors MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- src/slibc-human/machinesize.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'src/slibc-human') diff --git a/src/slibc-human/machinesize.c b/src/slibc-human/machinesize.c index 75aa989..9d33a5d 100644 --- a/src/slibc-human/machinesize.c +++ b/src/slibc-human/machinesize.c @@ -21,6 +21,7 @@ #include #include #include +#include @@ -37,7 +38,7 @@ __attribute__((nonnull)) static size_t prefix(char** restrict str, enum machinesize_mode mode) { -#define P(A, B) case A: case B: n++ +#define P(A, B) case A: case B: power++ char* p = *str; size_t power = 0; size_t base = 0; @@ -113,8 +114,8 @@ int machinesize(size_t* restrict size, const char* restrict str, enum machinesiz size_t word; long double dword; size_t u; - char* p; - char* q; + const char* p; + const char* q; int started = 0; int pluses = 0; int have_unitless = 0; @@ -143,7 +144,7 @@ int machinesize(size_t* restrict size, const char* restrict str, enum machinesiz dword *= (long double)u; if (dword > (long double)SIZE_MAX) return errno = ERANGE, -1; - down = (size_t)dword; + word = (size_t)dword; OVERFLOW(uaddl, word, r, &r, ERANGE, -1); } else @@ -151,7 +152,7 @@ int machinesize(size_t* restrict size, const char* restrict str, enum machinesiz if ((!started) || (have_unitless && (words > 1))) goto invalid; - return *save = r, 0; + return *size = r, 0; invalid: return errno = EINVAL, -1; } -- cgit v1.2.3-70-g09d2