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:
Benoît Dejean
2004-06-06 21:23:56 +00:00
parent 7de929d2d7
commit fe494bc846
4 changed files with 10 additions and 7 deletions

View File

@@ -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;
}