summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorpgen <p.gen.progs@gmail.com>2024-01-22 17:30:12 +0100
committerpgen <p.gen.progs@gmail.com>2024-01-22 17:34:52 +0100
commit704fa191b444aecc01aac875be453e79db2cac37 (patch)
treec07168589bfa7e8be33e089a7800f1185981dd20
parent0ed7710955e3dfe99b9447b33993488d0d90645c (diff)
Fix a compiler warning.
-rw-r--r--ctxopt.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/ctxopt.c b/ctxopt.c
index 8fa9843..7b25f35 100644
--- a/ctxopt.c
+++ b/ctxopt.c
@@ -7,6 +7,7 @@
/* ################################################################### */
#include <errno.h>
+#include <stddef.h>
#include <limits.h>
#include <stdio.h>
#include <stdlib.h>
@@ -1270,7 +1271,7 @@ get_word(char *str, char *buf, size_t len)
/* Get the word. */
/*"""""""""""""" */
- while (*s && !isspace(*s) && s - str < len)
+ while (*s && !isspace(*s) && s - str < (ptrdiff_t)len)
s++;
strncpy(buf, str, s - str);