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

@@ -120,13 +120,10 @@ glibtop_get_proc_map_s (glibtop *server, glibtop_proc_map *buf, pid_t pid)
return NULL;
}
#endif
if(!(entry = g_malloc(nmaps * sizeof(glibtop_map_entry))))
return NULL;
buf->number = nmaps;
buf->size = sizeof(glibtop_map_entry);
buf->total = nmaps * sizeof(glibtop_map_entry);
memset(entry, 0, nmaps * sizeof(glibtop_map_entry));
entry = g_malloc0(buf->total);
#if GLIBTOP_SOLARIS_RELEASE >= 560