Clear errno before calling the strtol functions. From Paul Stoeber to

OpenBSD by Ray Lai and Björn Sandell.


git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@19215 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
Love Hörnquist Åstrand
2006-12-04 23:41:18 +00:00
parent 623e559f60
commit 238e717568
2 changed files with 2 additions and 0 deletions

View File

@@ -157,6 +157,7 @@ read_limits_conf(const char *file, const struct passwd *pwd)
if(strcmp(args[3], "-") == 0) {
value = RLIM_INFINITY;
} else {
errno = 0;
value = strtol(args[3], &end, 10);
if(*end != '\0') {
syslog(LOG_ERR, "%s: line %d: bad value %s", file, lineno, args[3]);