Removed useless tests. Replace g_malloc + memset by g_malloc0 Replace
* proclist.c: (glibtop_get_proclist_s): Removed useless tests. * procmap.c: (glibtop_get_proc_map_s): Replace g_malloc + memset by g_malloc0 * procstate.c: (glibtop_get_proc_state_s): Replace strncpy by g_strlcpy.
This commit is contained in:
@@ -96,8 +96,7 @@ glibtop_get_proclist_s (glibtop *server, glibtop_proclist *buf,
|
||||
if(s_stat(buffer, &statb) < 0)
|
||||
return NULL;
|
||||
}
|
||||
if(!(pids_chain = g_malloc(sizeof(unsigned))))
|
||||
return NULL;
|
||||
pids_chain = g_malloc(sizeof(unsigned));
|
||||
*pids_chain = pid;
|
||||
return pids_chain;
|
||||
}
|
||||
|
Reference in New Issue
Block a user