Allocate thread_stat name arrays statically
[fio.git] / stat.c
diff --git a/stat.c b/stat.c
index 4bae5767c852cae4fb254a23f367c8a88463998e..564edf342014bd07d4f61f99c09aa57c63f6f731 100644 (file)
--- a/stat.c
+++ b/stat.c
@@ -727,8 +727,9 @@ void show_run_stats(void)
                        /*
                         * These are per-group shared already
                         */
-                       ts->name = td->o.name;
-                       ts->description = td->o.description;
+                       strncpy(ts->name, td->o.name, FIO_JOBNAME_SIZE);
+                       strncpy(ts->description, td->o.description,
+                                       FIO_JOBNAME_SIZE);
                        ts->groupid = td->groupid;
 
                        /*
@@ -750,10 +751,10 @@ void show_run_stats(void)
                        if (!td->error && td->o.continue_on_error &&
                            td->first_error) {
                                ts->error = td->first_error;
-                               ts->verror = td->verror;
+                               strcpy(ts->verror, td->verror);
                        } else  if (td->error) {
                                ts->error = td->error;
-                               ts->verror = td->verror;
+                               strcpy(ts->verror, td->verror);
                        }
                }