#include "epan/packet_info.h"
#include <epan/tap.h>
#include <epan/stat_cmd_args.h>
+#include <epan/strutil.h>
#include "register.h"
GPtrArray *gp;
guint i;
- current_time=((pinfo->fd->rel_ts.secs*1000)+(pinfo->fd->rel_ts.nsecs/1000000));
+ current_time=(gint32) ((pinfo->fd->rel_ts.secs*1000)+(pinfo->fd->rel_ts.nsecs/1000000));
/* the prev item before the main one is always the last interval we saw packets for */
it=mit->prev;
break;
case FT_RELATIVE_TIME:
new_time=fvalue_get(&((field_info *)gp->pdata[i])->value);
- val=new_time->secs*1000+new_time->nsecs/1000000;
+ val=(guint32) (new_time->secs*1000+new_time->nsecs/1000000);
if((it->frames==1)&&(i==0)){
it->counter=val;
} else if(val<it->counter){
break;
case FT_RELATIVE_TIME:
new_time=fvalue_get(&((field_info *)gp->pdata[i])->value);
- val=new_time->secs*1000+new_time->nsecs/1000000;
+ val=(guint32) (new_time->secs*1000+new_time->nsecs/1000000);
if((it->frames==1)&&(i==0)){
it->counter=val;
} else if(val>it->counter){
break;
case FT_RELATIVE_TIME:
new_time=fvalue_get(&((field_info *)gp->pdata[i])->value);
- val=new_time->secs*1000+new_time->nsecs/1000000;
+ val=(guint32) (new_time->secs*1000+new_time->nsecs/1000000);
it->counter+=val;
break;
}
calc_type_table[j].func_name);
exit(10);
}
- field=malloc(parenp-p+1);
+ field=g_malloc(parenp-p+1);
if(!field){
fprintf(stderr, "tshark: Out of memory.\n");
exit(10);
if(!hfi){
fprintf(stderr, "tshark: There is no field named '%s'.\n",
field);
- free(field);
+ g_free(field);
exit(10);
}
}
break;
}
- free(field);
+ g_free(field);
}
/*
if(pos==str){
register_io_tap(io, i, NULL);
} else if(pos==NULL) {
- tmp=g_malloc(strlen(str)+1);
- strcpy(tmp,str);
+ tmp=g_strdup(str);
register_io_tap(io, i, tmp);
} else {
tmp=g_malloc((pos-str)+1);
- strncpy(tmp,str,(pos-str));
- tmp[pos-str]=0;
+ g_strlcpy(tmp,str,(pos-str)+1);
register_io_tap(io, i, tmp);
}
str=pos+1;