summaryrefslogtreecommitdiff
path: root/lib/argmatch.c
diff options
context:
space:
mode:
authorJim Meyering <jim@meyering.net>1995-05-13 12:55:49 +0000
committerJim Meyering <jim@meyering.net>1995-05-13 12:55:49 +0000
commite5be6fdf8ae12316327b688d94fa1f7477872db9 (patch)
tree3b1c491f21e7e696f8757539324c352f2ce18a16 /lib/argmatch.c
parent143415e6b8035b913e8f02d009b8fbde80db0925 (diff)
downloadcoreutils-e5be6fdf8ae12316327b688d94fa1f7477872db9.tar.xz
(argmatch): Include sys/types.h and declare length argument with type size_t.
Diffstat (limited to 'lib/argmatch.c')
-rw-r--r--lib/argmatch.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/lib/argmatch.c b/lib/argmatch.c
index f3f1a50d2..d632890a4 100644
--- a/lib/argmatch.c
+++ b/lib/argmatch.c
@@ -17,6 +17,12 @@
/* Written by David MacKenzie <djm@ai.mit.edu> */
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include <sys/types.h>
+
#include <stdio.h>
#ifdef STDC_HEADERS
#include <string.h>
@@ -35,12 +41,12 @@ argmatch (arg, optlist)
char **optlist;
{
int i; /* Temporary index in OPTLIST. */
- int arglen; /* Length of ARG. */
+ size_t arglen; /* Length of ARG. */
int matchind = -1; /* Index of first nonexact match. */
int ambiguous = 0; /* If nonzero, multiple nonexact match(es). */
-
+
arglen = strlen (arg);
-
+
/* Test all elements for either exact match or abbreviated matches. */
for (i = 0; optlist[i]; i++)
{