Removed never executed if statements. Used g_strlcpy instead of strncpy.

* procargs.c: (glibtop_get_proc_args_s): Removed never executed if statements.
	* procstate.c: (glibtop_get_proc_state_s): Used g_strlcpy instead of
	strncpy.
This commit is contained in:
Benoît Dejean
2004-06-06 21:21:27 +00:00
parent bc4a882c4a
commit 7de929d2d7
3 changed files with 7 additions and 15 deletions

View File

@@ -74,13 +74,6 @@ glibtop_get_proc_args_s (glibtop *server, glibtop_proc_args *buf,
size = max_len != 0 ? max_len : 4096;
args_buffer = g_malloc (size);
if (args_buffer == NULL)
{
glibtop_error_io_r (server, "Cannot malloc procsinfo");
return NULL;
}
result = getargs(pinfo, sizeof(struct procsinfo), args_buffer, size);
if (result == -1)
@@ -112,14 +105,7 @@ glibtop_get_proc_args_s (glibtop *server, glibtop_proc_args *buf,
}
args = g_malloc (len);
if (args == NULL)
{
glibtop_error_io_r (server, "Cannot malloc procsinfo");
g_free(args_buffer);
return NULL;
}
memcpy(args, args_buffer, len);
g_free(args_buffer);