uevent: Use strchr here
This commit is contained in:
@@ -80,15 +80,13 @@ 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;
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
Reference in New Issue
Block a user