void clear_net_stats(void)
{
int i;
- for (i = 0; i < 16; i++)
- if (netstats[i].dev)
+ for (i = 0; i < 16; i++) {
+ if (netstats[i].dev) {
free(netstats[i].dev);
+ }
+ }
memset(netstats, 0, sizeof(netstats));
}
void free_dns_data(void);
struct net_stat {
- const char *dev;
+ char *dev;
int up;
long long last_read_recv, last_read_trans;
long long recv, trans;
case OBJ_if_up:
free(data.ifblock.s);
free(data.ifblock.str);
+ break;
#endif
#ifdef XMMS2
case OBJ_xmms2_artist:
if (!arg) {
ERR("if_up needs an argument");
obj->data.ifblock.s = 0;
- } else
+ } else {
obj->data.ifblock.s = strndup(arg, text_buffer_size);
+ }
#endif
#if defined(__OpenBSD__)
END OBJ(obsd_sensors_temp, 0)
#endif /* HAVE_LUA */
if (specials) {
- unsigned int i;
-
for (i = 0; i < special_count; i++) {
if (specials[i].type == GRAPH) {
free(specials[i].graph);
#include <math.h>
/* maximum number of special things, e.g. fonts, offsets, aligns, etc. */
-unsigned int max_specials = MAX_SPECIALS_DEFAULT;
+int max_specials = MAX_SPECIALS_DEFAULT;
/* create specials array on heap instead of stack with introduction of
* max_specials */
struct special_t *specials = NULL;
-unsigned int special_count;
+int special_count;
int default_bar_width = 0, default_bar_height = 6;
#ifdef X11
/* direct access to the registered specials (FIXME: bad encapsulation) */
extern struct special_t *specials;
-extern unsigned int special_count;
+extern int special_count;
extern int default_bar_width;
extern int default_bar_height;
#endif
/* max number of specials allowed (TODO: use linked list instead) */
-extern unsigned int max_specials;
+extern int max_specials;
#ifdef X11
/* scanning special arguments */