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
@ -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;
|
||||
@ -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 *);
|
||||
|
@ -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;
|
||||
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