Avoid warning in nscd config file parsing code

This commit is contained in:
Marek Polacek 2011-07-19 20:13:31 -04:00 committed by Ulrich Drepper
parent 8002999481
commit b902330ca8
2 changed files with 20 additions and 17 deletions

View File

@ -1,3 +1,8 @@
2011-07-15 Marek Polacek <mpolacek@redhat.com>
* nscd/nscd_conf.c (nscd_parse_file): Remove unnecessary condition
in the reload-count case.
2011-07-15 Liubov Dmitrieva <liubov.dmitrieva@intel.com> 2011-07-15 Liubov Dmitrieva <liubov.dmitrieva@intel.com>
* sysdeps/x86_64/multiarch/Makefile (sysdep_routines): Add * sysdeps/x86_64/multiarch/Makefile (sysdep_routines): Add

View File

@ -1,4 +1,4 @@
/* Copyright (c) 1998, 2000, 2003-2007, 2008 Free Software Foundation, Inc. /* Copyright (c) 1998, 2000, 2003-2008, 2011 Free Software Foundation, Inc.
This file is part of the GNU C Library. This file is part of the GNU C Library.
Contributed by Thorsten Kukuk <kukuk@suse.de>, 1998. Contributed by Thorsten Kukuk <kukuk@suse.de>, 1998.
@ -236,13 +236,11 @@ nscd_parse_file (const char *fname, struct database_dyn dbs[lastdb])
reload_count = UINT_MAX; reload_count = UINT_MAX;
else else
{ {
unsigned int count = strtoul (arg1, NULL, 0); unsigned long int count = strtoul (arg1, NULL, 0);
if (count > UINT8_MAX - 1) if (count > UINT8_MAX - 1)
reload_count = UINT_MAX; reload_count = UINT_MAX;
else if (count >= 0)
reload_count = count;
else else
error (0, 0, _("invalid value for 'reload-count': %u"), count); reload_count = count;
} }
} }
else if (strcmp (entry, "paranoia") == 0) else if (strcmp (entry, "paranoia") == 0)