summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristophe Fergeau <cfergeau@mandriva.com>2009-04-04 12:39:14 +0000
committerChristophe Fergeau <cfergeau@mandriva.com>2009-04-04 12:39:14 +0000
commit3903e2a6cb288585d1f00ea27c471b1f33e4f470 (patch)
tree763936668fe9a10d2e22672e0c0b234adf3040a1
parentdc307baef004000e6e7348056dc205235b4744dd (diff)
downloadldetect-3903e2a6cb288585d1f00ea27c471b1f33e4f470.tar
ldetect-3903e2a6cb288585d1f00ea27c471b1f33e4f470.tar.gz
ldetect-3903e2a6cb288585d1f00ea27c471b1f33e4f470.tar.bz2
ldetect-3903e2a6cb288585d1f00ea27c471b1f33e4f470.tar.xz
ldetect-3903e2a6cb288585d1f00ea27c471b1f33e4f470.zip
Don't use strchrnul since it's not available on dietlibc
-rw-r--r--hid.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/hid.c b/hid.c
index 345a1a8..d98bc8f 100644
--- a/hid.c
+++ b/hid.c
@@ -1,4 +1,3 @@
-#define _GNU_SOURCE
#include <sys/types.h>
#include <dirent.h>
#include <fnmatch.h>
@@ -49,7 +48,9 @@ static char *get_field_value(const char *fields, const char *field_name)
modalias = strstr(fields, field_name);
if (modalias == NULL)
return NULL;
- end = strchrnul(modalias, '\n');
+ end = strchr(modalias, '\n');
+ if (end == NULL)
+ end = modalias + strlen(modalias);
return strndup(modalias+strlen(field_name), end - (modalias+strlen(field_name)));
}