From 80e41032cd3ac7d33fb19976ad040f24f0fe1e00 Mon Sep 17 00:00:00 2001 From: Phil Sutter Date: Sun, 8 Nov 2009 14:01:14 +0100 Subject: [PATCH] {down,up}speedgraph: convert to match common signature --- src/conky.c | 4 ++-- src/net_stat.c | 8 ++++---- src/net_stat.h | 4 ++-- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/conky.c b/src/conky.c index 0d28b53a..250d26ba 100644 --- a/src/conky.c +++ b/src/conky.c @@ -1130,7 +1130,7 @@ void generate_text_internal(char *p, int p_max_size, } #ifdef X11 OBJ(downspeedgraph) { - print_downspeedgraph(obj, p); + print_downspeedgraph(obj, p, p_max_size); } #endif /* X11 */ OBJ(else) { @@ -1935,7 +1935,7 @@ void generate_text_internal(char *p, int p_max_size, } #ifdef X11 OBJ(upspeedgraph) { - print_upspeedgraph(obj, p); + print_upspeedgraph(obj, p, p_max_size); } #endif /* X11 */ OBJ(uptime_short) { diff --git a/src/net_stat.c b/src/net_stat.c index 0a948aa1..38d7d7f1 100644 --- a/src/net_stat.c +++ b/src/net_stat.c @@ -206,21 +206,21 @@ void parse_net_stat_graph_arg(struct text_object *obj, const char *arg, void *fr obj->data.opaque = get_net_stat(DEFAULTNETDEV, obj, free_at_crash); } -void print_downspeedgraph(struct text_object *obj, char *p) +void print_downspeedgraph(struct text_object *obj, char *p, int p_max_size) { struct net_stat *ns = obj->data.opaque; - if (!ns) + if (!ns || !p_max_size) return; new_graph(obj, p, ns->recv_speed / 1024.0); } -void print_upspeedgraph(struct text_object *obj, char *p) +void print_upspeedgraph(struct text_object *obj, char *p, int p_max_size) { struct net_stat *ns = obj->data.opaque; - if (!ns) + if (!ns || !p_max_size) return; new_graph(obj, p, ns->trans_speed / 1024.0); diff --git a/src/net_stat.h b/src/net_stat.h index 923e2189..6929ae90 100644 --- a/src/net_stat.h +++ b/src/net_stat.h @@ -71,8 +71,8 @@ void print_addrs(struct text_object *, char *, int); #endif /* __linux__ */ #ifdef X11 void parse_net_stat_graph_arg(struct text_object *, const char *, void *); -void print_downspeedgraph(struct text_object *, char *); -void print_upspeedgraph(struct text_object *, char *); +void print_downspeedgraph(struct text_object *, char *, int); +void print_upspeedgraph(struct text_object *, char *, int); #endif /* X11 */ #ifdef __linux__ #ifdef HAVE_IWLIB