diff options
-rw-r--r-- | helpers.c | 6 | ||||
-rw-r--r-- | helpers.h | 1 |
2 files changed, 7 insertions, 0 deletions
@@ -11,6 +11,12 @@ void *xmalloc(size_t size) { return ptr; } +unsigned long strict_strtoul(const char *nptr, int base) { + char *endptr; + unsigned long ret = strtoul(nptr, &endptr, base); + return (*endptr ? 0 : ret); +} + void cursinit(void) { setlocale(LC_ALL, ""); initscr(); @@ -7,6 +7,7 @@ #define KEY_ESCAPE 0x1b extern void *xmalloc(size_t size); +extern unsigned long strict_strtoul(const char *nptr, int base); extern void cursinit(void); extern void cursupdate(void); |