*
*/
-#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);
name, INT_MAX);
exit(1);
}
- return number;
+ return (int)number;
}
static int
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++) {
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);
#ifdef _WIN32
arg_list_utf_16to8(argc, argv);
+ create_app_running_mutex();
#endif /* _WIN32 */
/* Process the options first */
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;
}