Switch back all bzero() calls to use memset()
Even if it's uglier to use memset, bzero seems deprecated.
This commit is contained in:
@@ -99,7 +99,7 @@ gboolean get_task_list (GArray *task_list)
|
||||
#else
|
||||
struct kinfo_proc2 p = kp[i];
|
||||
#endif
|
||||
bzero(&t, sizeof(t));
|
||||
memset(&t, 0, sizeof(t));
|
||||
t.pid = p.p_pid;
|
||||
t.ppid = p.p_ppid;
|
||||
t.uid = p.p_uid;
|
||||
@@ -114,11 +114,11 @@ gboolean get_task_list (GArray *task_list)
|
||||
size = 1024;
|
||||
if ((args = malloc(size)) == NULL)
|
||||
errx(1,"failed to allocate memory for argv structures at %zu", size);
|
||||
bzero(args, size);
|
||||
memset(args, 0, size);
|
||||
for (;; size *= 2) {
|
||||
if ((args = realloc(args, size)) == NULL)
|
||||
errx(1,"failed to allocate memory (size=%zu) for argv structures of pid %d", size, t.pid);
|
||||
bzero(args, size);
|
||||
memset(args, 0, size);
|
||||
mib[0] = CTL_KERN;
|
||||
mib[1] = KERN_PROC_ARGS;
|
||||
mib[2] = t.pid;
|
||||
|
||||
Reference in New Issue
Block a user