Fio 3.15
[fio.git] / server.c
index 2a33770733e99e447f16511061f9f21a2699f2f5..23e549a590a709e4072b4de33704a32b46f3dd73 100644 (file)
--- a/server.c
+++ b/server.c
@@ -1470,9 +1470,12 @@ void fio_server_send_ts(struct thread_stat *ts, struct group_run_stats *rs)
 
        memset(&p, 0, sizeof(p));
 
-       strncpy(p.ts.name, ts->name, FIO_JOBNAME_SIZE - 1);
-       strncpy(p.ts.verror, ts->verror, FIO_VERROR_SIZE - 1);
-       strncpy(p.ts.description, ts->description, FIO_JOBDESC_SIZE - 1);
+       strncpy(p.ts.name, ts->name, FIO_JOBNAME_SIZE);
+       p.ts.name[FIO_JOBNAME_SIZE - 1] = '\0';
+       strncpy(p.ts.verror, ts->verror, FIO_VERROR_SIZE);
+       p.ts.verror[FIO_VERROR_SIZE - 1] = '\0';
+       strncpy(p.ts.description, ts->description, FIO_JOBDESC_SIZE);
+       p.ts.description[FIO_JOBDESC_SIZE - 1] = '\0';
 
        p.ts.error              = cpu_to_le32(ts->error);
        p.ts.thread_number      = cpu_to_le32(ts->thread_number);