Reviewed-by: "Serge E. Hallyn" <serge@hallyn.com>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
#include <libeconf.h>
#endif
+#include "atoi/a2i.h"
#include "atoi/str2i.h"
#include "defines.h"
#include "getdef.h"
* values are handled.
*/
-int getdef_num (const char *item, int dflt)
+int
+getdef_num(const char *item, int dflt)
{
- struct itemdef *d;
- long val;
+ int val;
+ struct itemdef *d;
if (!def_loaded) {
def_load ();
return dflt;
}
- if ( (str2sl(&val, d->value) == -1)
- || (val > INT_MAX)
- || (val < -1)) {
+ if (a2si(&val, d->value, NULL, 0, -1, INT_MAX) == -1) {
fprintf (shadow_logfd,
_("configuration error - cannot parse %s value: '%s'"),
item, d->value);