From: Matthew Fernandez Date: Mon, 10 Oct 2022 15:16:04 +0000 (-0700) Subject: smyrna on_gvprbuttonsave_clicked: simplify file writing X-Git-Tag: 7.0.0~8^2~2 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=620aab9e3fbb6fe656ace9059fbffaa57ac6919d;p=graphviz smyrna on_gvprbuttonsave_clicked: simplify file writing Compilers like GCC can make this optimizing transform themselves, but this change aids less sophisticated compilers. --- diff --git a/cmd/smyrna/gui/menucallbacks.c b/cmd/smyrna/gui/menucallbacks.c index 772bb63d3..6d863fbad 100644 --- a/cmd/smyrna/gui/menucallbacks.c +++ b/cmd/smyrna/gui/menucallbacks.c @@ -414,7 +414,7 @@ void on_gvprbuttonsave_clicked(GtkWidget * widget, gpointer user_data) gtk_text_buffer_get_start_iter(gtkbuf, &startit); gtk_text_buffer_get_end_iter(gtkbuf, &endit); bf2 = gtk_text_buffer_get_text(gtkbuf, &startit, &endit, 0); - fprintf(output_file, "%s", bf2); + fputs(bf2, output_file); free(bf2); fclose(output_file); }