From f206729df5064f2414a542b37b18079ee3e13fe8 Mon Sep 17 00:00:00 2001 From: Mike Massonnet Date: Sun, 2 Nov 2014 13:26:19 +0100 Subject: [PATCH] Fix stringsize - 1 (bug #9172) --- panel-plugin/netload.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/panel-plugin/netload.c b/panel-plugin/netload.c index 95811df..a5f55d9 100644 --- a/panel-plugin/netload.c +++ b/panel-plugin/netload.c @@ -238,11 +238,11 @@ static gboolean update_monitors(t_global_monitor *global) if (global->monitor->options.show_bars) gtk_progress_bar_set_fraction(GTK_PROGRESS_BAR(global->monitor->status[i]), temp); - format_byte_humanreadable( buffer[i], BUFSIZ, display[i], 2 ); - format_byte_humanreadable( buffer_panel[i], BUFSIZ, display[i], 0 ); + format_byte_humanreadable( buffer[i], BUFSIZ - 1, display[i], 2 ); + format_byte_humanreadable( buffer_panel[i], BUFSIZ - 1, display[i], 0 ); } - format_byte_humanreadable( buffer[TOT], BUFSIZ, (display[IN]+display[OUT]), 2 ); + format_byte_humanreadable( buffer[TOT], BUFSIZ - 1, (display[IN]+display[OUT]), 2 ); { char* ip = get_ip_address(&(global->monitor->data));