From 354ef5e7710eaa0e009d7a2b199e7c3ce2e4c643 Mon Sep 17 00:00:00 2001 From: Andreas Schneider Date: Thu, 1 Aug 2013 10:37:02 +0200 Subject: [PATCH] client: Fix strtol error check. --- client/csync_client.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/client/csync_client.c b/client/csync_client.c index 6d2ec89035..38f83f8e6a 100644 --- a/client/csync_client.c +++ b/client/csync_client.c @@ -114,15 +114,15 @@ static void print_help() static int c_atoi(const char *string, int *result) { - char *errptr; + char *end = NULL; int i; if (string == NULL) { return -1; } - i = strtol(string, &errptr, 10); - if (errptr == NULL) { + i = strtol(string, &end, 10); + if (!(end != NULL && end[0] == '\0')) { /* error case, the input string had an error. */ return -1; }