chiark / gitweb /
[PATCH] allow simple-build-check.sh to go faster if MAKEOPTS is set
[elogind.git] / libsysfs / sysfs / libsysfs.h
index cbde2f5783bb52cbe36ee5c28552a5d289c24a47..29194f61a60ff340a5b68a0b6fb53642cd8aa33c 100644 (file)
@@ -25,6 +25,7 @@
 
 #include <sys/types.h>
 #include <string.h>
+#include "dlist.h"
 
 /* 
  * Defines to prevent buffer overruns
 #define safestrcpy(to, from)   strncpy(to, from, sizeof(to)-1)
 #define safestrcat(to, from)   strncat(to, from, sizeof(to) - strlen(to)-1)
 
-#define safestrncpy(to, from, maxsize) \
+#define safestrcpymax(to, from, max) \
 do { \
-       to[maxsize-1] = '\0'; \
-       strncpy(to, from, maxsize-1); \
+       to[max-1] = '\0'; \
+       strncpy(to, from, max-1); \
 } while (0)
 
-#define safestrncat(to, from, maxsize) \
+#define safestrcatmax(to, from, max) \
 do { \
-       to[maxsize-1] = '\0'; \
-       strncat(to, from, maxsize - strlen(to)-1); \
+       to[max-1] = '\0'; \
+       strncat(to, from, max - strlen(to)-1); \
 } while (0)
 
 /*