From 03dd8b848340be20fd17ab566a051954ab87866a Mon Sep 17 00:00:00 2001 From: o9000 Date: Sat, 8 Aug 2015 08:47:32 +0200 Subject: [PATCH] uevent: Use strchr here --- src/util/uevent.c | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) 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;