fix char cpu name
authorcompudj <compudj@04897980-b3bd-0310-b5e0-8ef037075253>
Sun, 21 Aug 2005 03:32:26 +0000 (03:32 +0000)
committercompudj <compudj@04897980-b3bd-0310-b5e0-8ef037075253>
Sun, 21 Aug 2005 03:32:26 +0000 (03:32 +0000)
git-svn-id: http://ltt.polymtl.ca/svn@1036 04897980-b3bd-0310-b5e0-8ef037075253

ltt/branches/poly/ltt/tracefile.c

index 0f72957c4c0982065885a709cd1841e7f34c89dc..6b027c4fc02182249a4af874bcc8f9494df1f4f8 100644 (file)
@@ -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) {
This page took 0.025023 seconds and 4 git commands to generate.