From 3c320e688ae7e04319373066bf1e5c16730eba31 Mon Sep 17 00:00:00 2001 From: Reinhard Sojka Date: Mon, 6 Jan 2014 14:10:00 +1300 Subject: [PATCH] Bug 3995: compile error on CentOS 5 with GCC 4.1.2 --- compat/xstrto.cc | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) 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; -- 2.47.2