chiark / gitweb /
[PATCH] udev - fix debug info for multiple rule file config
[elogind.git] / udev.h
diff --git a/udev.h b/udev.h
index 3b676acf40d99ab1a7a137dbbe49804b80f6ecde..5737c84c9d16fec99f1e337426b093522c580278 100644 (file)
--- a/udev.h
+++ b/udev.h
@@ -85,6 +85,18 @@ do { \
        strncat(to, from, maxsize - strlen(to)-1); \
 } while (0)
 
+#define strintcat(to, i) \
+do { \
+       to[sizeof(to)-1] = '\0'; \
+       snprintf((to) + strlen(to), sizeof(to) - strlen(to)-1, "%u", i); \
+} while (0)
+
+#define strnintcat(to, i, maxsize) \
+do { \
+       to[maxsize-1] = '\0'; \
+       snprintf((to) + strlen(to), maxsize - strlen(to)-1, "%u", i); \
+} while (0)
+
 static inline char *get_action(void)
 {
        char *action;