1
0
mirror of https://github.com/Llewellynvdm/conky.git synced 2024-12-25 20:11:11 +00:00

Fix building without C99

This commit is contained in:
Nikolas Garofil 2009-11-12 21:33:57 +01:00
parent 6c4f069f00
commit 1d0b68e60d

View File

@ -93,12 +93,13 @@ void print_pid_cwd(struct text_object *obj, char *p, int p_max_size)
void scan_pid_environ_arg(struct text_object *obj, const char *arg, void* free_at_crash)
{
pid_t pid;
int i;
struct environ_data* ed = malloc(sizeof(struct environ_data));
ed->var = malloc(strlen(arg));
ed->var = malloc(strlen(arg));
if(sscanf(arg, "%d %s", &pid, ed->var) == 2) {
asprintf(&ed->file, PROCDIR "/%d/environ", pid);
for(int i = 0; ed->var[i] != 0; i++) {
for(i = 0; ed->var[i] != 0; i++) {
ed->var[i] = toupper(ed->var[i]);
}
obj->data.opaque = ed;