Blob Blame History Raw
diff -dur xfce4-taskmanager-0.4.0.orig/src/types.h xfce4-taskmanager-0.4.0/src/types.h
--- xfce4-taskmanager-0.4.0.orig/src/types.h	2008-05-17 10:20:35.000000000 +0200
+++ xfce4-taskmanager-0.4.0/src/types.h	2008-05-24 01:29:00.000000000 +0200
@@ -73,7 +73,7 @@
 
 gboolean show_cached_as_free; /* Show memory used Cache as free memory */
 
-guint sort_column;
+gint sort_column;
 guint sort_type;
 
 enum
diff -dur xfce4-taskmanager-0.4.0.orig/src/xfce-taskmanager-linux.c xfce4-taskmanager-0.4.0/src/xfce-taskmanager-linux.c
--- xfce4-taskmanager-0.4.0.orig/src/xfce-taskmanager-linux.c	2008-05-18 19:42:21.000000000 +0200
+++ xfce4-taskmanager-0.4.0/src/xfce-taskmanager-linux.c	2008-05-24 01:29:00.000000000 +0200
@@ -20,6 +20,7 @@
 
 #include "xfce-taskmanager-linux.h"
 
+
 struct task get_task_details(gint pid)
 {
 	FILE *task_file;
@@ -32,9 +33,10 @@
 	struct stat status;
 	gchar filename[255];
 	gchar cmdline_filename[255];
+	static gint pagesize = 0;
 
-	sprintf(filename, "/proc/%i/stat", pid);
-	sprintf(cmdline_filename, "/proc/%i/cmdline", pid);
+	g_snprintf(filename, sizeof(filename), "/proc/%i/stat", pid);
+	g_snprintf(cmdline_filename, sizeof(cmdline_filename), "/proc/%i/cmdline", pid);
 
 	stat(filename, &status);
 
@@ -299,7 +301,7 @@
 	if(task_id > 0 && signal != 0)
 	{
 		gint ret = 0;
-		
+
 		ret = kill(task_id, signal);
 
 		if(ret != 0)
@@ -313,8 +315,8 @@
 	if(task_id > 0)
 	{
 		gchar command[128] = "";
-		g_sprintf(command, "renice %d %d > /dev/null", prio, task_id);
-		
+		g_snprintf(command, sizeof(command), "renice %d %d > /dev/null", prio, task_id);
+
 		if(system(command) != 0)
 			xfce_err(_("Couldn't set priority %d to the task with ID %d"), prio, task_id);
 	}
diff -dur xfce4-taskmanager-0.4.0.orig/src/xfce-taskmanager-linux.h xfce4-taskmanager-0.4.0/src/xfce-taskmanager-linux.h
--- xfce4-taskmanager-0.4.0.orig/src/xfce-taskmanager-linux.h	2008-05-18 19:42:21.000000000 +0200
+++ xfce4-taskmanager-0.4.0/src/xfce-taskmanager-linux.h	2008-05-24 01:29:00.000000000 +0200
@@ -39,8 +39,6 @@
 #define SIGNAL_CONT	SIGCONT
 #define SIGNAL_STOP	SIGSTOP
 
-static gint pagesize = 0;
-
 struct task get_task_details(gint pid);
 GArray *get_task_list(void); 
 gboolean get_system_status(system_status *sys_stat);