]> granicus.if.org Git - graphviz/commitdiff
smyrna on_gvprbuttonsave_clicked: simplify file writing
authorMatthew Fernandez <matthew.fernandez@gmail.com>
Mon, 10 Oct 2022 15:16:04 +0000 (08:16 -0700)
committerMatthew Fernandez <matthew.fernandez@gmail.com>
Sat, 15 Oct 2022 00:32:13 +0000 (17:32 -0700)
Compilers like GCC can make this optimizing transform themselves, but this
change aids less sophisticated compilers.

cmd/smyrna/gui/menucallbacks.c

index 772bb63d3478f1a3d59c08eafd099e8071c91404..6d863fbad2fa468aa761b6dbf5df46ac4c88c2cd 100644 (file)
@@ -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);
        }