From 6b0d6a9f32ee9f4dfffc4c7b7b9ad549565af042 Mon Sep 17 00:00:00 2001 From: Pavel Labath Date: Tue, 26 Jun 2012 22:43:12 +0200 Subject: [PATCH] Fix a segfault in graph drawing code (sf.net #3537523) PS: boy, is that code messy or what bug reported by b3niup --- src/conky.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/conky.cc b/src/conky.cc index 0677edb0..1dcf9835 100644 --- a/src/conky.cc +++ b/src/conky.cc @@ -1552,7 +1552,7 @@ int draw_each_line_inner(char *s, int special_index, int last_special_applied) w = current->width; if (w == 0) { w = text_start_x + text_width - cur_x - 1; - current->graph_width = w - 1; + current->graph_width = MAX(w - 1, 0); if (current->graph_width != current->graph_allocated) { w = current->graph_allocated + 1; }