Follow up to rev 34073: Since "-b files:0" is no longer necessary to
[obnox/wireshark/wip.git] / tap-rpcstat.c
index 5ba75043a047db2a398e2d08a6a1cb9f638cf6d9..1f43ad74a7860465493d17d5700757e5823530be 100644 (file)
@@ -202,11 +202,7 @@ rpcstat_draw(void *prs)
 {
        rpcstat_t *rs=prs;
        guint32 i;
-#ifdef G_HAVE_UINT64
        guint64 td;
-#else
-       guint32 td;
-#endif
        printf("\n");
        printf("===================================================================\n");
        printf("%s Version %d RTT Statistics:\n", rs->prog, rs->version);
@@ -214,8 +210,7 @@ rpcstat_draw(void *prs)
        printf("Procedure        Calls   Min RTT   Max RTT   Avg RTT\n");
        for(i=0;i<rs->num_procedures;i++){
                /* scale it to units of 10us.*/
-               /* for long captures with a large tot time, this can overflow on 32bit */
-               td=(int)rs->procedures[i].tot.secs;
+               td=rs->procedures[i].tot.secs;
                td=td*100000+(int)rs->procedures[i].tot.nsecs/10000;
                if(rs->procedures[i].num){
                        td/=rs->procedures[i].num;
@@ -223,7 +218,7 @@ rpcstat_draw(void *prs)
                        td=0;
                }
 
-               printf("%-15s %6d %3d.%05d %3d.%05d %3d.%05d\n",
+               printf("%-15s %6d %3d.%05d %3d.%05d %3" G_GINT64_MODIFIER "u.%05" G_GINT64_MODIFIER "u\n",
                        rs->procedures[i].proc,
                        rs->procedures[i].num,
                        (int)rs->procedures[i].min.secs,rs->procedures[i].min.nsecs/10000,
@@ -298,8 +293,7 @@ rpcstat_init(const char *optarg, void* userdata _U_)
        rs->program=program;
        rs->version=version;
        if(filter){
-               rs->filter=g_malloc(strlen(filter)+1);
-               strcpy(rs->filter, filter);
+               rs->filter=g_strdup(filter);
        } else {
                rs->filter=NULL;
        }
@@ -338,7 +332,7 @@ rpcstat_init(const char *optarg, void* userdata _U_)
  *
  */
 
-       error_string=register_tap_listener("rpc", rs, filter, rpcstat_reset, rpcstat_packet, rpcstat_draw);
+       error_string=register_tap_listener("rpc", rs, filter, 0, rpcstat_reset, rpcstat_packet, rpcstat_draw);
        if(error_string){
                /* error, we failed to attach to the tap. clean up */
                g_free(rs->procedures);