X-Git-Url: https://git.kernel.dk/?p=fio.git;a=blobdiff_plain;f=gclient.c;h=64324177ef1a8bb747346adf12f65a2e1a1de2b9;hp=7e5071d65b420315aea022b7d2dccce65dde74da;hb=0b288ba164c10009ea9f4a2c737bd29863ebc60c;hpb=a6d7953002576946bd7d6703fca698a16ad454a5 diff --git a/gclient.c b/gclient.c index 7e5071d6..64324177 100644 --- a/gclient.c +++ b/gclient.c @@ -121,7 +121,7 @@ static void gfio_text_op(struct fio_client *client, struct fio_net_cmd *cmd) GtkTreeIter iter; struct tm *tm; time_t sec; - char tmp[64], timebuf[80]; + char tmp[64], timebuf[96]; sec = p->log_sec; tm = localtime(&sec); @@ -318,7 +318,7 @@ static void gfio_update_thread_status(struct gui_entry *ge, static char message[100]; const char *m = message; - strncpy(message, status_message, sizeof(message) - 1); + snprintf(message, sizeof(message), "%s", status_message); gtk_progress_bar_set_text(GTK_PROGRESS_BAR(ge->thread_status_pb), m); gtk_progress_bar_set_fraction(GTK_PROGRESS_BAR(ge->thread_status_pb), perc / 100.0); gtk_widget_queue_draw(ge->ui->window); @@ -330,7 +330,7 @@ static void gfio_update_thread_status_all(struct gui *ui, char *status_message, static char message[100]; const char *m = message; - strncpy(message, status_message, sizeof(message) - 1); + strncpy(message, sizeof(message), "%s", status_message); gtk_progress_bar_set_text(GTK_PROGRESS_BAR(ui->thread_status_pb), m); gtk_progress_bar_set_fraction(GTK_PROGRESS_BAR(ui->thread_status_pb), perc / 100.0); gtk_widget_queue_draw(ui->window);