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) {
|
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 {
|
||||||
|
|
Loading…
Reference in a new issue