diff options
Diffstat (limited to 'udev_lib.h')
-rw-r--r-- | udev_lib.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/udev_lib.h b/udev_lib.h index 18ce25ccc7..53ad92d505 100644 --- a/udev_lib.h +++ b/udev_lib.h @@ -59,6 +59,12 @@ do { \ snprintf((to) + strlen(to), maxsize - strlen(to)-1, "%u", i); \ } while (0) +#define strlongcat(to, i) \ +do { \ + to[sizeof(to)-1] = '\0'; \ + snprintf((to) + strlen(to), sizeof(to) - strlen(to)-1, "%li", i); \ +} while (0) + #define foreach_strpart(str, separator, pos, len) \ for(pos = str, len = 0; \ (pos) < ((str) + strlen(str)); \ |