mirror of
https://github.com/Llewellynvdm/conky.git
synced 2024-12-27 20:44:56 +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:
parent
b0e5e2cd22
commit
cc35a00a30
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user