From: Reinhard Sojka Date: Sun, 12 Jan 2014 02:03:10 +0000 (-0700) Subject: Bug 3995: compile error on CentOS 5 with GCC 4.1.2 X-Git-Tag: SQUID_3_4_3~18 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3cae3e98886a8e54065573f139e225942d8f98c3;p=thirdparty%2Fsquid.git Bug 3995: compile error on CentOS 5 with GCC 4.1.2 --- diff --git a/compat/xstrto.cc b/compat/xstrto.cc index 1fffd5412a..e6482ece4a 100644 --- a/compat/xstrto.cc +++ b/compat/xstrto.cc @@ -55,11 +55,10 @@ bool xstrtoul(const char *s, char **end, unsigned long *value, unsigned long min, unsigned long max) { - unsigned long v; - char *my_end; + char *my_end = NULL; errno = 0; - v = strtoul(s, &my_end, 0); + unsigned long v = strtoul(s, &my_end, 0); if (my_end == s) return false; @@ -81,10 +80,8 @@ bool xstrtoui(const char *s, char **end, unsigned int *value, unsigned int min, unsigned int max) { - unsigned long v; - bool ret; - - ret = xstrtoul(s, end, &v, min, max); + unsigned long v = 0; + bool ret = xstrtoul(s, end, &v, min, max); if (value != NULL) { *value = v;