Use isspace to test for whitespace

This commit is contained in:
Benedikt Heine 2018-11-11 14:34:51 +01:00
parent d8d457f500
commit ae1b20881e

View File

@ -2,6 +2,7 @@
#include "utils.h" #include "utils.h"
#include <assert.h> #include <assert.h>
#include <ctype.h>
#include <errno.h> #include <errno.h>
#include <glib.h> #include <glib.h>
#include <stdio.h> #include <stdio.h>
@ -134,7 +135,6 @@ char *string_to_path(char *string)
gint64 string_to_time(const char *string) gint64 string_to_time(const char *string)
{ {
assert(string); assert(string);
errno = 0; errno = 0;
@ -155,7 +155,7 @@ gint64 string_to_time(const char *string)
} }
// endptr may point to a separating space // endptr may point to a separating space
while (*endptr == ' ') while (isspace(*endptr))
endptr++; endptr++;
if (STRN_EQ(endptr, "ms", 2)) if (STRN_EQ(endptr, "ms", 2))