uevent: Use strchr here
This commit is contained in:
parent
553adbb946
commit
03dd8b8483
1 changed files with 6 additions and 8 deletions
|
@ -80,15 +80,13 @@ 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) {
|
||||
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;
|
||||
} else {
|
||||
|
|
Loading…
Reference in a new issue