uevent: Use strchr here

This commit is contained in:
o9000 2015-08-08 08:47:32 +02:00
parent 553adbb946
commit 03dd8b8483

View file

@ -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;