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) { for (; s < end; s += strlen(s) + 1) {
if (first) { if (first) {
const char *p; const char *p = strchr(s, '@');
for (p = s; *p != '@'; p++) { if (!p) {
if (!*p) { /* error: kernel events contain @ */
/* error: kernel events contain @ */ /* triggered by udev events, though */
/* triggered by udev events, though */ free(ev);
free(ev); return NULL;
return NULL;
}
} }
ev->path = strdup(p+1); ev->path = strdup(p+1);
first = FALSE; first = FALSE;