Commit: 243dcbbcfe7c265dcf18a28f347d28e1be968194
Parent: bed949d0c688fa45f1338eb6073bc6adb3c2163b
Author: Randy Palamar
Date: Sun, 13 Oct 2024 21:36:35 -0600
drop ctype.h
Diffstat:
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/jdict.c b/jdict.c
@@ -1,5 +1,4 @@
/* See LICENSE for license details. */
-#include <ctype.h>
#include <dirent.h>
#include <fcntl.h>
#include <limits.h>
@@ -27,6 +26,7 @@ typedef ptrdiff_t size;
#endif
#define ARRAY_COUNT(a) (sizeof(a) / sizeof(*a))
+#define ISSPACE(c) ((c) == ' ' || (c) == '\n' || (c) == '\t')
#define MEGABYTE (1024ULL * 1024ULL)
@@ -208,8 +208,8 @@ s8trim(s8 str)
{
u8 *p = str.s + str.len - 1;
- for (; str.len && isspace(*p); str.len--, p--);
- for (; str.len && isspace(*str.s); str.len--, str.s++);
+ for (; str.len && ISSPACE(*p); str.len--, p--);
+ for (; str.len && ISSPACE(*str.s); str.len--, str.s++);
return str;
}