Fix for bug 3112:
[obnox/wireshark/wip.git] / tap-bootpstat.c
index 10a3d11aac82c7c79d608f99ae29f1a32db8177b..1f23e441013dd59a25e5763dd8b9f300fdd61131 100644 (file)
@@ -3,8 +3,8 @@
  *
  * $Id$
  *
- * Ethereal - Network traffic analyzer
- * By Gerald Combs <gerald@ethereal.com>
+ * Wireshark - Network traffic analyzer
+ * By Gerald Combs <gerald@wireshark.org>
  * Copyright 1998 Gerald Combs
  * 
  * This program is free software; you can redistribute it and/or
@@ -137,7 +137,7 @@ dhcpstat_draw(void *psp)
 /* When called, this function will create a new instance of tap-boopstat.
  */
 static void
-dhcpstat_init(const char *optarg)
+dhcpstat_init(const char *optarg, void* userdata _U_)
 {
        dhcpstat_t *sp;
        const char      *filter=NULL;
@@ -152,8 +152,7 @@ dhcpstat_init(const char *optarg)
        sp = g_malloc( sizeof(dhcpstat_t) );
        sp->hash = g_hash_table_new( g_str_hash, g_str_equal);
        if(filter){
-               sp->filter=g_malloc(strlen(filter)+1);
-               strcpy(sp->filter,filter);
+               sp->filter=g_strdup(filter);
        } else {
                sp->filter=NULL;
        }
@@ -170,7 +169,7 @@ dhcpstat_init(const char *optarg)
                /* error, we failed to attach to the tap. clean up */
                g_free(sp->filter);
                g_free(sp);
-               fprintf(stderr, "tethereal: Couldn't register dhcp,stat tap: %s\n",
+               fprintf(stderr, "tshark: Couldn't register dhcp,stat tap: %s\n",
                                error_string->str);
                g_string_free(error_string, TRUE);
                exit(1);
@@ -182,6 +181,6 @@ dhcpstat_init(const char *optarg)
 void
 register_tap_listener_gtkdhcpstat(void)
 {
-       register_stat_cmd_arg("bootp,stat,", dhcpstat_init);
+       register_stat_cmd_arg("bootp,stat,", dhcpstat_init,NULL);
 }