diff options
author | Chris Maynard <Christopher.Maynard@GTECH.COM> | 2010-11-17 03:29:12 +0000 |
---|---|---|
committer | Chris Maynard <Christopher.Maynard@GTECH.COM> | 2010-11-17 03:29:12 +0000 |
commit | 1e2ae5a88a0100ec87d613f8a0d1f94ea3eda703 (patch) | |
tree | 364188d3a603dafea951d4297e0921b0956807d5 /gtk/iax2_analysis.c | |
parent | 9aeb1dac1770c29b74b0278eda284701a2e8f731 (diff) |
Quote all fields when exporting to CSV. Fixes bug 2811.
svn path=/trunk/; revision=34920
Diffstat (limited to 'gtk/iax2_analysis.c')
-rw-r--r-- | gtk/iax2_analysis.c | 36 |
1 files changed, 18 insertions, 18 deletions
diff --git a/gtk/iax2_analysis.c b/gtk/iax2_analysis.c index 80ff41bde7..be79046c96 100644 --- a/gtk/iax2_analysis.c +++ b/gtk/iax2_analysis.c @@ -1867,9 +1867,9 @@ static gboolean save_csv_as_ok_cb(GtkWidget *w _U_, gpointer fc /*user_data_t *u for(j = 0; j < NUM_COLS; j++) { if (j == 0) { - fprintf(fp,"%s",titles[j]); + fprintf(fp,"\"%s\"",titles[j]); } else { - fprintf(fp,",%s",titles[j]); + fprintf(fp,",\"%s\"",titles[j]); } } fprintf(fp,"\n"); @@ -1893,13 +1893,13 @@ static gboolean save_csv_as_ok_cb(GtkWidget *w _U_, gpointer fc /*user_data_t *u 5, &date_str, 6, &length, -1); - fprintf(fp, "%u",packet); - fprintf(fp, ",%.2f", delta); - fprintf(fp, ",%.2f", jitter); - fprintf(fp, ",%.2f", ipbw); - fprintf(fp, ",%s", status_str); - fprintf(fp, ",%s", date_str); - fprintf(fp, ",%u", length); + fprintf(fp, "\"%u\"",packet); + fprintf(fp, ",\"%.2f\"", delta); + fprintf(fp, ",\"%.2f\"", jitter); + fprintf(fp, ",\"%.2f\"", ipbw); + fprintf(fp, ",\"%s\"", status_str); + fprintf(fp, ",\"%s\"", date_str); + fprintf(fp, ",\"%u\"", length); fprintf(fp,"\n"); g_free(status_str); g_free(date_str); @@ -1947,9 +1947,9 @@ static gboolean save_csv_as_ok_cb(GtkWidget *w _U_, gpointer fc /*user_data_t *u } for(j = 0; j < NUM_COLS; j++) { if (j == 0) { - fprintf(fp,"%s",titles[j]); + fprintf(fp,"\"%s\"",titles[j]); } else { - fprintf(fp,",%s",titles[j]); + fprintf(fp,",\"%s\"",titles[j]); } } fprintf(fp,"\n"); @@ -1975,13 +1975,13 @@ static gboolean save_csv_as_ok_cb(GtkWidget *w _U_, gpointer fc /*user_data_t *u 5, &date_str, 6, &length, -1); - fprintf(fp, "%u",packet); - fprintf(fp, ",%.2f", delta); - fprintf(fp, ",%.2f", jitter); - fprintf(fp, ",%.2f", ipbw); - fprintf(fp, ",%s", status_str); - fprintf(fp, ",%s", date_str); - fprintf(fp, ",%u", length); + fprintf(fp, "\"%u\"",packet); + fprintf(fp, ",\"%.2f\"", delta); + fprintf(fp, ",\"%.2f\"", jitter); + fprintf(fp, ",\"%.2f\"", ipbw); + fprintf(fp, ",\"%s\"", status_str); + fprintf(fp, ",\"%s\"", date_str); + fprintf(fp, ",\"%u\"", length); fprintf(fp,"\n"); g_free(status_str); g_free(date_str); |