From d8bbd232cdd910e70ce15f9a11d0986b6a5c4621 Mon Sep 17 00:00:00 2001 From: ruengeler Date: Thu, 3 Dec 2015 13:47:33 +0100 Subject: SCTP: Fix warning found by PVS Studio Change-Id: I713eb6eff3681573baf77274847a32a4cc6b9ee0 Reviewed-on: https://code.wireshark.org/review/12408 Reviewed-by: Anders Broman --- ui/gtk/sctp_graph_dlg.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'ui/gtk/sctp_graph_dlg.c') diff --git a/ui/gtk/sctp_graph_dlg.c b/ui/gtk/sctp_graph_dlg.c index 0811c3671c..3a0e055071 100644 --- a/ui/gtk/sctp_graph_dlg.c +++ b/ui/gtk/sctp_graph_dlg.c @@ -1416,8 +1416,8 @@ on_button_release_event (GtkWidget *widget _U_, GdkEventButton *event, gpointer PangoLayout *layout; cairo_t *cr; - g_snprintf(label_string, 15, "%d", 0); - memcpy(label_string,(gchar *)g_locale_to_utf8(label_string, -1 , NULL, NULL, NULL), 15); + g_snprintf(label_string, sizeof(label_string), "%d", 0); + memcpy(label_string,(gchar *)g_locale_to_utf8(label_string, -1 , NULL, NULL, NULL), sizeof(label_string)); layout = gtk_widget_create_pango_layout(u_data->io->draw_area, label_string); pango_layout_get_pixel_size(layout, &label_width, &label_height); @@ -1542,7 +1542,7 @@ on_button_release_event (GtkWidget *widget _U_, GdkEventButton *event, gpointer sacklist = u_data->assoc->sort_sack2; s_size = u_data->assoc->n_sack_chunks_ep2; } - x_tolerance = (gdouble)((u_data->io->tmp_width / u_data->io->axis_width*1.0))*5/1000000.0; + x_tolerance = (gdouble)(u_data->io->tmp_width / u_data->io->axis_width*1.0)*5/1000000.0; y_tolerance = (guint32)(((u_data->io->max_y - u_data->io->min_y) / (u_data->io->surface_height-TOP_BORDER-BOTTOM_BORDER-u_data->io->offset)) * 2.0); if (y_tolerance==0) y_tolerance = 2; @@ -1623,7 +1623,7 @@ on_button_release_event (GtkWidget *widget _U_, GdkEventButton *event, gpointer position = event->x + 5; - memcpy(label_string,(gchar *)g_locale_to_utf8(label_string, -1 , NULL, NULL, NULL), 15); + memcpy(label_string,(gchar *)g_locale_to_utf8(label_string, -1 , NULL, NULL, NULL), sizeof(label_string)); pango_layout_set_text(layout, label_string, -1); pango_layout_get_pixel_size(layout, &lwidth, NULL); -- cgit v1.2.1