summaryrefslogtreecommitdiffstats
path: root/helpers.c
diff options
context:
space:
mode:
Diffstat (limited to 'helpers.c')
-rw-r--r--helpers.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/helpers.c b/helpers.c
index 5685d29..7a146c3 100644
--- a/helpers.c
+++ b/helpers.c
@@ -91,3 +91,13 @@ char* strtok_r(char *str, const char *delim, char **nextp)
}
#endif
+/* There is no strnlen in DJGPP */
+#if defined(__DJGPP__)
+size_t strnlen(const char *str, size_t n)
+{
+ size_t i;
+ for (i = 0; i < n && str[i] != '\0'; i++)
+ ;
+ return i;
+}
+#endif
OpenPOWER on IntegriCloud