diff options
author | Bastien Nocera <hadess@src.gnome.org> | 2003-10-20 13:55:44 +0000 |
---|---|---|
committer | Bastien Nocera <hadess@src.gnome.org> | 2003-10-20 13:55:44 +0000 |
commit | ba36a20cb81c8b3561b99a2412a9fd71b7cd8c12 (patch) | |
tree | 88a5de6613816aa1db1aea08c73978c303837df9 /lib/init.c | |
parent | af8478ca5fb759bd9e22ead29d83be5634b8fc87 (diff) | |
download | libgtop-ba36a20cb81c8b3561b99a2412a9fd71b7cd8c12.tar.gz |
- replace all the xmalloc crap by glib memory management functions
Diffstat (limited to 'lib/init.c')
-rw-r--r-- | lib/init.c | 17 |
1 files changed, 7 insertions, 10 deletions
@@ -45,14 +45,14 @@ _init_server (glibtop *server, const unsigned features) const char *temp = getenv ("LIBGTOP_SERVER") ? getenv ("LIBGTOP_SERVER") : LIBGTOP_SERVER; - server->server_command = glibtop_strdup_r (server, temp); + server->server_command = g_strdup (temp); } if (server->server_rsh == NULL) { const char *temp = getenv ("LIBGTOP_RSH") ? getenv ("LIBGTOP_RSH") : "/usr/bin/ssh"; - server->server_rsh = glibtop_strdup_r (server, temp); + server->server_rsh = g_strdup (temp); } /* Try to get server method, but don't override if already @@ -82,7 +82,7 @@ _init_server (glibtop *server, const unsigned features) /* Everything up to the next colon is the method. */ - command = glibtop_strdup_r (server, server->server_command+1); + command = g_strdup (server->server_command+1); temp = strstr (command, ":"); if (temp) *temp = 0; @@ -103,19 +103,16 @@ _init_server (glibtop *server, const unsigned features) if (temp == NULL) { /* If no value was set, we use 'localhost'. */ if (server->server_host == NULL) - server->server_host = glibtop_strdup_r - (server, "localhost"); + server->server_host = g_strdup ("localhost"); } else { char *temp2 = strstr (temp+1, ":"); if (temp2) *temp2 = 0; /* Override default. */ if (server->server_host) - glibtop_free_r (server, - (char *) server->server_host); + g_free ((char *) server->server_host); - server->server_host = glibtop_strdup_r - (server, temp+1); + server->server_host = g_strdup (temp+1); temp = temp2; } @@ -151,7 +148,7 @@ _init_server (glibtop *server, const unsigned features) } - glibtop_free_r (server, command); + g_free (command); } glibtop * |