diff options
author | Christophe Fergeau <cfergeau@mandriva.com> | 2009-04-04 12:39:14 +0000 |
---|---|---|
committer | Christophe Fergeau <cfergeau@mandriva.com> | 2009-04-04 12:39:14 +0000 |
commit | 3903e2a6cb288585d1f00ea27c471b1f33e4f470 (patch) | |
tree | 763936668fe9a10d2e22672e0c0b234adf3040a1 | |
parent | dc307baef004000e6e7348056dc205235b4744dd (diff) | |
download | ldetect-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.c | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -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))); } |