X-Git-Url: https://git.kernel.dk/?p=fio.git;a=blobdiff_plain;f=gclient.c;h=64324177ef1a8bb747346adf12f65a2e1a1de2b9;hp=70dda48385e7548fac350bb3cf712339f5f9b056;hb=4a4199035ee07da312b5a611637a164ebe8a4805;hpb=358ffaa6c37acb26e0f507934ba8a6f98f34ffee diff --git a/gclient.c b/gclient.c index 70dda483..64324177 100644 --- a/gclient.c +++ b/gclient.c @@ -1,4 +1,4 @@ -#include +#include #include #include @@ -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); @@ -641,7 +641,7 @@ static void gfio_client_timed_out(struct fio_client *client) gdk_threads_leave(); } -static void gfio_client_stop(struct fio_client *client, struct fio_net_cmd *cmd) +static void gfio_client_stop(struct fio_client *client) { struct gfio_client *gc = client->client_data; @@ -1099,7 +1099,7 @@ static void gfio_show_clat_percentiles(struct gfio_client *gc, GtkWidget *vbox, struct thread_stat *ts, int ddir) { - unsigned int *io_u_plat = ts->io_u_plat[ddir]; + uint64_t *io_u_plat = ts->io_u_plat[ddir]; unsigned long long nr = ts->clat_stat[ddir].samples; fio_fp64_t *plist = ts->percentile_list; unsigned int len, scale_down;