{down,up}speedgraph: convert to match common signature
authorPhil Sutter <phil@nwl.cc>
Sun, 8 Nov 2009 13:01:14 +0000 (14:01 +0100)
committerPhil Sutter <phil@nwl.cc>
Thu, 19 Nov 2009 22:52:39 +0000 (23:52 +0100)
src/conky.c
src/net_stat.c
src/net_stat.h

index 0d28b53..250d26b 100644 (file)
@@ -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) {
index 0a948aa..38d7d7f 100644 (file)
@@ -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);
index 923e218..6929ae9 100644 (file)
@@ -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