summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorErik de Castro Lopo <erikd@mega-nerd.com>2017-01-17 18:28:28 +1100
committerErik de Castro Lopo <erikd@mega-nerd.com>2017-01-17 19:41:31 +1100
commit78d67ff870f54564d35efb9771c846710e88b0c0 (patch)
tree4b91ed8e29835edf31b3a4c1c242f107a040add6
parentc80a819bd77f9b8d94f7dd1e1deac1ea9664e1bb (diff)
downloadflac-78d67ff870f54564d35efb9771c846710e88b0c0.tar.gz
getopt.c: Pointer comparison fix
* Remove <stdint.h> because MSVC 2005 (and probably 2008) don't have it. * Fix pointer difference caclulation between `nameend` and `nextchar`. Patch-from: lvqcl <lvqcl.mail@gmail.com>
-rw-r--r--src/share/getopt/getopt.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/share/getopt/getopt.c b/src/share/getopt/getopt.c
index 7928ad33..23c119c0 100644
--- a/src/share/getopt/getopt.c
+++ b/src/share/getopt/getopt.c
@@ -54,7 +54,6 @@
#endif
#include <stdio.h>
-#include <stdint.h>
/* Comment out all this code if we are using the GNU C Library, and are not
actually compiling the library itself. This code is part of the GNU C
@@ -664,8 +663,7 @@ share___getopt_internal (argc, argv, optstring, longopts, longind, long_only)
for (p = longopts, option_index = 0; p->name; p++, option_index++)
if (!strncmp (p->name, nextchar, nameend - nextchar))
{
- if ((uint32_t) (nameend - nextchar)
- == (uint32_t) strlen (p->name))
+ if ((size_t) (nameend - nextchar) == strlen (p->name))
{
/* Exact match found. */
pfound = p;
@@ -853,7 +851,7 @@ share___getopt_internal (argc, argv, optstring, longopts, longind, long_only)
for (p = longopts, option_index = 0; p->name; p++, option_index++)
if (!strncmp (p->name, nextchar, nameend - nextchar))
{
- if ((uint32_t) (nameend - nextchar) == strlen (p->name))
+ if ((size_t) (nameend - nextchar) == strlen (p->name))
{
/* Exact match found. */
pfound = p;