Permalink
Browse files

fix some mingw warnings in getopt.c

From a patch from Claus Klein <claus.klein@arcormail.de>.
  • Loading branch information...
evmar committed Jul 27, 2012
1 parent 2c7354b commit 00d68972b13ec20fd09301784ae330f7a1921568
Showing with 2 additions and 6 deletions.
  1. +2 −6 src/getopt.c
View
@@ -91,10 +91,6 @@ gpietsch@comcast.net
#include "getopt.h"
#endif
-#ifdef _WIN32
-#pragma warning(disable: 4701)
-#endif
-
/* macros */
/* types */
@@ -159,7 +155,7 @@ getopt_internal (int argc, char **argv, char *shortopts,
char *possible_arg = NULL;
int longopt_match = -1;
int has_arg = -1;
- char *cp;
+ char *cp = NULL;
int arg_next = 0;
/* first, deal with silly parameters and easy stuff */
@@ -255,7 +251,7 @@ getopt_internal (int argc, char **argv, char *shortopts,
longopts[optindex].name, match_chars) == 0)
{
/* do we have an exact match? */
- if (match_chars == (int) (strlen (longopts[optindex].name)))
+ if (match_chars == strlen (longopts[optindex].name))
{
longopt_match = optindex;
break;

0 comments on commit 00d6897

Please sign in to comment.