Update to V9.0.0 (2009-12)
[obnox/wireshark/wip.git] / mergecap.c
index 358ebe23592ef0d5bad29a94550947b5360107c7..bf58298ccaa10f059aac1ae2ef839c929105f65e 100644 (file)
 #include <string.h>
 #include "wtap.h"
 
-#ifdef NEED_GETOPT_H
-#include "getopt.h"
+#ifdef HAVE_GETOPT_H
+#include <getopt.h>
+#else
+#include "wsgetopt.h"
 #endif
 
 #include "svnversion.h"
 static int
 get_natural_int(const char *string, const char *name)
 {
-  long number;
+  int number;
   char *p;
 
-  number = strtol(string, &p, 10);
+  number = (int) strtol(string, &p, 10);
   if (p == string || *p != '\0') {
     fprintf(stderr, "mergecap: The specified %s \"%s\" isn't a decimal number\n",
            name, string);
@@ -67,7 +69,7 @@ get_natural_int(const char *string, const char *name)
 static int
 get_positive_int(const char *string, const char *name)
 {
-  long number;
+  int number;
 
   number = get_natural_int(string, name);
 
@@ -140,8 +142,6 @@ static void list_encap_types(void) {
 int
 main(int argc, char *argv[])
 {
-  extern char *optarg;
-  extern int   optind;
   int          opt;
   gboolean     do_append     = FALSE;
   gboolean     verbose       = FALSE;