1
0
mirror of https://github.com/Llewellynvdm/conky.git synced 2024-11-17 18:45:10 +00:00

fix potential bugs in snprintf

This commit is contained in:
Nikolas Garofil 2009-11-12 21:48:15 +01:00
parent 1d0b68e60d
commit e26c9977f2

View File

@ -181,7 +181,7 @@ void print_pid_environ_list(struct text_object *obj, char *p, int p_max_size)
buf[i-1] = ';';
}
buf[i-1] = 0;
snprintf(p, p_max_size, buf);
snprintf(p, p_max_size, "%s", buf);
free(buf);
fclose(infofile);
} else {
@ -200,7 +200,7 @@ void print_pid_readlink(struct text_object *obj, char *p, int p_max_size)
memset(buf, 0, p_max_size);
if(readlink(obj->data.s, buf, p_max_size) >= 0) {
snprintf(p, p_max_size, buf);
snprintf(p, p_max_size, "%s", buf);
} else {
NORM_ERR(READERR, obj->data.s);
}