if (type & SIT_IDENTITY) {
ret = g_snprintf(msg, SIT_MSG_NUM-n, "%sIDENTITY", sep);
- if (ret == -1 || ret >= SIT_MSG_NUM-n) {
+ if (ret >= SIT_MSG_NUM-n) {
/* Truncated. */
return msg;
}
return msg;
}
ret = g_snprintf(msg, SIT_MSG_NUM-n, "%sSECRECY", sep);
- if (ret == -1 || ret >= SIT_MSG_NUM-n) {
+ if (ret >= SIT_MSG_NUM-n) {
/* Truncated. */
return msg;
}
return msg;
}
ret = g_snprintf(msg, SIT_MSG_NUM-n, "%sINTEGRITY", sep);
- if (ret == -1 || ret >= SIT_MSG_NUM-n) {
+ if (ret >= SIT_MSG_NUM-n) {
/* Truncated. */
return msg;
}
expert_set_info_vformat(
packet_info *pinfo, proto_item *pi, int group, int severity, const char *format, va_list ap)
{
- int ret; /*tmp return value */
char formatted[300];
expert_info_t *ei;
proto_tree *tree;
}
/* XXX - use currently nonexistant se_vsnprintf instead */
- ret = g_vsnprintf(formatted, sizeof(formatted), format, ap);
- if ((ret == -1) || (ret >= (int)sizeof(formatted)))
- formatted[sizeof(formatted) - 1] = '\0';
+ g_vsnprintf(formatted, sizeof(formatted), format, ap);
ei = ep_alloc(sizeof(expert_info_t));
ei->packet_num = pinfo->fd->num;
/* Set the title */
if (mac_lte_stat_dlg_w != NULL) {
- g_snprintf (title, 255, "Wireshark: LTE MAC Traffic Statistics: %s",
+ g_snprintf (title, sizeof(title), "Wireshark: LTE MAC Traffic Statistics: %s",
cf_get_display_name(&cfile));
gtk_window_set_title(GTK_WINDOW(mac_lte_stat_dlg_w), title);
}
- g_snprintf(title, 255, "UL/DL-SCH data");
+ g_snprintf(title, sizeof(title), "UL/DL-SCH data");
gtk_frame_set_label(GTK_FRAME(mac_lte_stat_ues_lb), title);
memset(&common_stats, 0, sizeof(common_stats));
hs->number_of_packets = 0;
/* Set title */
- g_snprintf(title, 255, "Wireshark: LTE MAC Statistics: %s",
+ g_snprintf(title, sizeof(title), "Wireshark: LTE MAC Statistics: %s",
cf_get_display_name(&cfile));
mac_lte_stat_dlg_w = window_new_with_geom(GTK_WINDOW_TOPLEVEL, title, "LTE MAC Statistics");
static gchar buf[SCS_HUGE_SIZE];
va_start( list, fmt );
- g_vsnprintf(buf, SCS_HUGE_SIZE-1 ,fmt, list);
+ g_vsnprintf(buf, SCS_HUGE_SIZE, fmt, list);
va_end( list );
return scs_subscribe(c,buf);