Fix evil strtol bug (breaks booleans)
I mentioned earlier that strtol wasn't behaving according to manpage. That's actually not true - it works fine, and that was just covering up a much worse bug. The bug caused fetch_int() to always return 0, and as a result to reset all booleans to 0. It wasn't noticed, because my test boolean was explicitly set to 1, and I wasn't paying attention to the other one that I have in booleans.local.
Changes:
- fix the bug (pass right value into strtol)
- remove errno printing - the errno doesn't make any sense most of the time
libsemanage/src/parse_utils.c +3 -3
@@ -256,10 +256,10 @@ int parse_fetch_int( goto err; } - value =strtol (info->ptr, &test,10 ); + value =strtol (str, &test,10 );if (*test !='\0' ) { -ERR (handle,"could not parse numeric value: %s (%s: %u)\n%s" , -strerror (errno), info->filename, +ERR (handle,"could not parse numeric value \"%s\": " +"(%s: %u)\n%s" , str, info->filename, info->lineno, info->orig_line); goto err; }