summaryrefslogtreecommitdiff
path: root/udev.h
diff options
context:
space:
mode:
Diffstat (limited to 'udev.h')
-rw-r--r--udev.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/udev.h b/udev.h
index 9327e90913..32fda379e5 100644
--- a/udev.h
+++ b/udev.h
@@ -98,9 +98,9 @@ do { \
} while (0)
#define foreach_strpart(str, separator, pos, len) \
- for(pos = 0, len = strcspn(str, separator); \
- (pos) < strlen(str); \
- pos = pos + (len) + 1, len = strcspn((str) + pos, separator)) \
+ for(pos = str, len = 0; \
+ (pos) < ((str) + strlen(str)); \
+ pos = pos + len + strspn(pos, separator), len = strcspn(pos, separator)) \
if (len > 0)
static inline char *get_action(void)