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

Fix segmentation violation bug in freebsd.cc

Last patch removed a needed strndup().

Signed-off-by: Alexander Graf <agraf@znc.in>
Signed-off-by: Pavel Labath <pavelo@centrum.sk>
This commit is contained in:
Alexander Graf 2010-05-24 14:48:17 +02:00 committed by Pavel Labath
parent b0e5e2cd22
commit cc35a00a30

View File

@ -778,6 +778,7 @@ proc_find_top(struct process **cpu, struct process **mem, struct process **time)
tmp = (process *) malloc(sizeof(struct process));
memcpy(tmp, &processes[i], sizeof(struct process));
tmp->name = strndup(processes[i].name, text_buffer_size);
ttmp = mem[i];
mem[i] = tmp;
@ -793,6 +794,7 @@ proc_find_top(struct process **cpu, struct process **mem, struct process **time)
tmp = (process *) malloc(sizeof(struct process));
memcpy(tmp, &processes[i], sizeof(struct process));
tmp->name = strndup(processes[i].name, text_buffer_size);
ttmp = cpu[i];
cpu[i] = tmp;
@ -808,6 +810,7 @@ proc_find_top(struct process **cpu, struct process **mem, struct process **time)
tmp = (process *) malloc(sizeof(struct process));
memcpy(tmp, &processes[i], sizeof(struct process));
tmp->name = strndup(processes[i].name, text_buffer_size);
ttmp = time[i];
time[i] = tmp;