From: Reinhard Sojka Date: Mon, 6 Jan 2014 01:10:00 +0000 (+1300) Subject: Bug 3995: compile error on CentOS 5 with GCC 4.1.2 X-Git-Tag: SQUID_3_5_0_1~438 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=3c320e688ae7e04319373066bf1e5c16730eba31;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;