# HG changeset patch # User Mario de Sousa # Date 1339227346 -3600 # Node ID 97b85630e496bcc206b21606660d5962bdf0719c # Parent cb704eca7e37557c6d4ea810f5b39466aad94e71 Re-insert errno=0 before calling strtoXX() (thanks go to Manuele) diff -r cb704eca7e37 -r 97b85630e496 absyntax_utils/absyntax_utils.cc --- a/absyntax_utils/absyntax_utils.cc Fri Jun 08 19:47:45 2012 +0100 +++ b/absyntax_utils/absyntax_utils.cc Sat Jun 09 08:35:46 2012 +0100 @@ -129,6 +129,7 @@ for(unsigned int i = 3; i < strlen(hex_integer->value); i++) if (hex_integer->value[i] != '_') str += hex_integer->value[i]; + errno = 0; // since strtoXX() may legally return 0, we must set errno to 0 to detect errors correctly! ret = strtoull(str.c_str(), &endptr, 16); if (errno != 0) ERROR; @@ -148,6 +149,7 @@ for(unsigned int i = 3; i < strlen(real_sym->value); i++) if (real_sym->value[i] != '_') str += real_sym->value[i]; + errno = 0; // since strtoXX() may legally return 0, we must set errno to 0 to detect errors correctly! #if (real64_t == float) ret = strtof(str.c_str(), NULL); #elif (real64_t == double)