diff options
Diffstat (limited to 'libudev')
-rw-r--r-- | libudev/libudev-util.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/libudev/libudev-util.c b/libudev/libudev-util.c index 3a67b0cd5d..030b78cd22 100644 --- a/libudev/libudev-util.c +++ b/libudev/libudev-util.c @@ -87,13 +87,13 @@ int util_log_priority(const char *priority) int prio; prio = strtol(priority, &endptr, 10); - if (endptr[0] == '\0') + if (endptr[0] == '\0' || isspace(endptr[0])) return prio; if (strncmp(priority, "err", 3) == 0) return LOG_ERR; - if (strcmp(priority, "info") == 0) + if (strncmp(priority, "info", 4) == 0) return LOG_INFO; - if (strcmp(priority, "debug") == 0) + if (strncmp(priority, "debug", 5) == 0) return LOG_DEBUG; return 0; } |