diff --git a/src/util/uevent.c b/src/util/uevent.c index 8dd18b3..9a9959f 100644 --- a/src/util/uevent.c +++ b/src/util/uevent.c @@ -80,14 +80,12 @@ static struct uevent *uevent_new(char *buffer, int size) { for (; s < end; s += strlen(s) + 1) { if (first) { - const char *p; - for (p = s; *p != '@'; p++) { - if (!*p) { - /* error: kernel events contain @ */ - /* triggered by udev events, though */ - free(ev); - return NULL; - } + const char *p = strchr(s, '@'); + if (!p) { + /* error: kernel events contain @ */ + /* triggered by udev events, though */ + free(ev); + return NULL; } ev->path = strdup(p+1); first = FALSE;