aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--getopt.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/getopt.c b/getopt.c
index 3f7390672a..04875848b2 100644
--- a/getopt.c
+++ b/getopt.c
@@ -28,6 +28,8 @@
#include "config.h"
#endif
+#include <string.h>
+
#ifndef __STDC__
/* This is a separate conditional since some stdc systems
reject `defined (const)'. */
@@ -477,7 +479,7 @@ _getopt_internal (argc, argv, optstring, longopts, longind, long_only)
p++, option_index++)
if (!strncmp (p->name, nextchar, s - nextchar))
{
- if (s - nextchar == strlen (p->name))
+ if ((size_t)(s - nextchar) == strlen (p->name))
{
/* Exact match found. */
pfound = p;