From: kay.sievers@vrfy.org Date: Tue, 2 Mar 2004 07:17:59 +0000 (-0800) Subject: [PATCH] fix stroul endptr use X-Git-Tag: 020~17 X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=elogind.git;a=commitdiff_plain;h=aebef544cb4417bcf1dbc6d9d0ad795e5525e41c [PATCH] fix stroul endptr use The endptr is never NULL, so here we hopefully do the right thing. --- diff --git a/klibc_fixups.c b/klibc_fixups.c index 1241eb7d1..99460c32f 100644 --- a/klibc_fixups.c +++ b/klibc_fixups.c @@ -74,7 +74,7 @@ static unsigned long get_id_by_name(const char *uname, const char *dbfile) if (strcmp(uname, name) == 0) { id = strtoul(idstr, &tail, 10); - if (tail == NULL) + if (tail[0] != '\0') id = -1; else dbg("id for '%s' is '%li'", name, id); diff --git a/namedev.c b/namedev.c index 2ebf276f6..ed8d6c180 100644 --- a/namedev.c +++ b/namedev.c @@ -198,7 +198,7 @@ static int get_format_len(char **str) if (isdigit(*str[0])) { num = (int) strtoul(*str, &tail, 10); - if (tail != NULL) { + if (num > 0) { *str = tail; dbg("format length=%i", num); return num;