mirror of
https://github.com/Llewellynvdm/conky.git
synced 2024-11-17 02:25:09 +00:00
small fixes
git-svn-id: https://conky.svn.sourceforge.net/svnroot/conky/trunk/conky@205 7f574dfc-610e-0410-a909-a81674777703
This commit is contained in:
parent
9b1ec59cb3
commit
c1330e5693
12
src/conky.c
12
src/conky.c
@ -939,6 +939,9 @@ static void free_text_objects()
|
||||
free(text_objects[i].data.ifblock.s);
|
||||
break;
|
||||
case OBJ_text:
|
||||
case OBJ_font:
|
||||
free(text_objects[i].data.s);
|
||||
break;
|
||||
case OBJ_exec:
|
||||
free(text_objects[i].data.s);
|
||||
break;
|
||||
@ -1046,9 +1049,9 @@ if (s[0] == '#') {
|
||||
obj->data.l = arg ? get_x11_color(arg) : default_fg_color;
|
||||
#endif /* X11 */
|
||||
END
|
||||
OBJ(font, 0)
|
||||
OBJ(font, 0)
|
||||
obj->data.s = scan_font(arg);
|
||||
END
|
||||
END
|
||||
OBJ(downspeed, INFO_NET) obj->data.net = get_net_stat(arg);
|
||||
END OBJ(downspeedf, INFO_NET) obj->data.net = get_net_stat(arg);
|
||||
END OBJ(downspeedgraph, INFO_NET)
|
||||
@ -2890,7 +2893,7 @@ static inline int get_string_width_special(char *s)
|
||||
unsigned int i;
|
||||
while (*p) {
|
||||
if (*p == SPECIAL_CHAR) {
|
||||
/* shift everything over by 1 */
|
||||
/* shift everything over by 1 so that the special char doesn't mess up the size calculation */
|
||||
for (i = 0; i < strlen(p); i++) {
|
||||
*(p + i) = *(p + i + 1);
|
||||
}
|
||||
@ -3901,6 +3904,9 @@ static void main_loop()
|
||||
#endif /* X11 */
|
||||
|
||||
}
|
||||
#ifdef X11
|
||||
XDestroyRegion(region);
|
||||
#endif /* X11 */
|
||||
}
|
||||
|
||||
static void load_config_file(const char *);
|
||||
|
10
src/linux.c
10
src/linux.c
@ -432,11 +432,13 @@ void update_load_average()
|
||||
|
||||
#define PROC_I8K "/proc/i8k"
|
||||
#define I8K_DELIM " "
|
||||
static char *i8k_procbuf;
|
||||
static char *i8k_procbuf = NULL;
|
||||
void update_i8k()
|
||||
{
|
||||
FILE *fp;
|
||||
i8k_procbuf = (char*)malloc(128*sizeof(char));
|
||||
if (!i8k_procbuf) {
|
||||
i8k_procbuf = (char*)malloc(128*sizeof(char));
|
||||
}
|
||||
if ((fp = fopen(PROC_I8K,"r")) == NULL) {
|
||||
CRIT_ERR("/proc/i8k doesn't exist! use insmod to make sure the kernel driver is loaded...");
|
||||
}
|
||||
@ -458,10 +460,6 @@ void update_i8k()
|
||||
i8k.right_fan_rpm = strtok(NULL,I8K_DELIM);
|
||||
i8k.ac_status = strtok(NULL,I8K_DELIM);
|
||||
i8k.buttons_status = strtok(NULL,I8K_DELIM);
|
||||
|
||||
if(i8k_procbuf) {
|
||||
free(i8k_procbuf);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user