[Automatic manuf, services and enterprise-numbers update for 2013-05-26]
[metze/wireshark/wip.git] / mergecap.c
index 4f9869d029c2a26d9f8603e349c3b35311e2b6fc..433518824fe968db73511d983805a02851e3498f 100644 (file)
@@ -25,9 +25,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
 #include "config.h"
-#endif
 
 #include <stdio.h>
 #include <stdlib.h>
 static int
 get_natural_int(const char *string, const char *name)
 {
-  int number;
+  long number;
   char *p;
 
-  number = (int) strtol(string, &p, 10);
+  number = strtol(string, &p, 10);
   if (p == string || *p != '\0') {
     fprintf(stderr, "mergecap: The specified %s \"%s\" isn't a decimal number\n",
            name, string);
@@ -83,7 +81,7 @@ get_natural_int(const char *string, const char *name)
            name, INT_MAX);
     exit(1);
   }
-  return number;
+  return (int)number;
 }
 
 static int
@@ -161,7 +159,7 @@ list_capture_types(void) {
   struct string_elem *captypes;
   GSList *list = NULL;
 
-  captypes = g_malloc(sizeof(struct string_elem) * WTAP_NUM_FILE_TYPES);
+  captypes = g_new(struct string_elem,WTAP_NUM_FILE_TYPES);
 
   fprintf(stderr, "mergecap: The available capture file types for the \"-F\" flag are:\n");
   for (i = 0; i < WTAP_NUM_FILE_TYPES; i++) {
@@ -182,7 +180,7 @@ list_encap_types(void) {
     struct string_elem *encaps;
     GSList *list = NULL;
 
-    encaps = g_malloc(sizeof(struct string_elem) * WTAP_NUM_ENCAP_TYPES);
+    encaps = g_new(struct string_elem,WTAP_NUM_ENCAP_TYPES);
     fprintf(stderr, "mergecap: The available encapsulation types for the \"-T\" flag are:\n");
     for (i = 0; i < WTAP_NUM_ENCAP_TYPES; i++) {
         encaps[i].sstr = wtap_encap_short_string(i);
@@ -225,6 +223,7 @@ main(int argc, char *argv[])
 
 #ifdef _WIN32
   arg_list_utf_16to8(argc, argv);
+  create_app_running_mutex();
 #endif /* _WIN32 */
 
   /* Process the options first */
@@ -450,8 +449,7 @@ main(int argc, char *argv[])
       phdr = &snap_phdr;
     }
 
-    if (!wtap_dump(pdh, phdr, wtap_pseudoheader(in_file->wth),
-         wtap_buf_ptr(in_file->wth), &write_err)) {
+    if (!wtap_dump(pdh, phdr, wtap_buf_ptr(in_file->wth), &write_err)) {
       got_write_error = TRUE;
       break;
     }