mirror of
https://github.com/nextcloud/desktop.git
synced 2024-10-28 16:13:53 +03:00
client: Fix strtol error check.
This commit is contained in:
parent
7247eed4ac
commit
354ef5e771
1 changed files with 3 additions and 3 deletions
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue