From 69bd59ed20497e8453727155aa54c9b515e1c3ab Mon Sep 17 00:00:00 2001 From: compudj Date: Sun, 21 Aug 2005 03:32:26 +0000 Subject: [PATCH] fix char cpu name git-svn-id: http://ltt.polymtl.ca/svn@1036 04897980-b3bd-0310-b5e0-8ef037075253 --- ltt/branches/poly/ltt/tracefile.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/ltt/branches/poly/ltt/tracefile.c b/ltt/branches/poly/ltt/tracefile.c index 0f72957c..6b027c4f 100644 --- a/ltt/branches/poly/ltt/tracefile.c +++ b/ltt/branches/poly/ltt/tracefile.c @@ -542,6 +542,8 @@ int get_tracefile_name_number(const gchar *raw_name, strncpy(char_name, raw_name, underscore_pos); + char_name[underscore_pos] = '\0'; + *name = g_quark_from_string(char_name); *num = cpu_num; @@ -609,21 +611,21 @@ gboolean ltt_tracefile_group_has_cpu_online(gpointer data) * A tracefile group is simply an array where all the per cpu tracefiles sits. */ -static int open_tracefiles(LttTrace *trace, char *root_path, - char *relative_path) +static int open_tracefiles(LttTrace *trace, gchar *root_path, + gchar *relative_path) { DIR *dir = opendir(root_path); struct dirent *entry; struct stat stat_buf; int ret; - char path[PATH_MAX]; + gchar path[PATH_MAX]; int path_len; - char *path_ptr; + gchar *path_ptr; int rel_path_len; - char rel_path[PATH_MAX]; - char *rel_path_ptr; + gchar rel_path[PATH_MAX]; + gchar *rel_path_ptr; LttTracefile tmp_tf; if(dir == NULL) { -- 2.34.1