Patchwork [1/2] strtosz() use unsigned char as isspace() is not defined for signed char

login
register
mail settings
Submitter Jes Sorensen
Date Jan. 17, 2011, 2:56 p.m.
Message ID <1295276206-15592-1-git-send-email-Jes.Sorensen@redhat.com>
Download mbox | patch
Permalink /patch/79185/
State New
Headers show

Comments

Jes Sorensen - Jan. 17, 2011, 2:56 p.m.
From: Jes Sorensen <Jes.Sorensen@redhat.com>

Bug pointed out by Erik Blake, thanks!

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
---
 cutils.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

Patch

diff --git a/cutils.c b/cutils.c
index 7984bc1..f97ef39 100644
--- a/cutils.c
+++ b/cutils.c
@@ -294,7 +294,8 @@  int fcntl_setfl(int fd, int flag)
 ssize_t strtosz_suffix(const char *nptr, char **end, const char default_suffix)
 {
     ssize_t retval = -1;
-    char *endptr, c, d;
+    char *endptr;
+    unsigned char c, d;
     int mul_required = 0;
     double val, mul, integral, fraction;