2
0
mirror of https://github.com/sudo-project/sudo.git synced 2025-08-31 14:25:15 +00:00

The OpenBSD strtonum() uses very short error strings that can't

be translated usefully.  Convert them to longer strings on error.
Also use the longer strings for atomode() and atoid().
This commit is contained in:
Todd C. Miller
2013-12-11 13:43:10 -07:00
parent d83bfb9fe6
commit cbf41b8b96
12 changed files with 94 additions and 27 deletions

View File

@@ -610,7 +610,7 @@ store_int(char *val, struct sudo_defs_types *def, int op)
i = strtonum(val, INT_MIN, INT_MAX, &errstr);
if (errstr != NULL) {
sudo_debug_printf(SUDO_DEBUG_ERROR|SUDO_DEBUG_LINENO,
"%s is %s", val, errstr);
"%s: %s", val, errstr);
debug_return_bool(false);
}
def->sd_un.ival = i;
@@ -633,7 +633,7 @@ store_uint(char *val, struct sudo_defs_types *def, int op)
u = strtonum(val, 0, UINT_MAX, &errstr);
if (errstr != NULL) {
sudo_debug_printf(SUDO_DEBUG_ERROR|SUDO_DEBUG_LINENO,
"%s is %s", val, errstr);
"%s: %s", val, errstr);
debug_return_bool(false);
}
/* XXX - should have uival */