]> granicus.if.org Git - graphviz/commitdiff
tclpkg graphcmd: remove some uses of bare 'sprintf'
authorMatthew Fernandez <matthew.fernandez@gmail.com>
Thu, 8 Sep 2022 00:27:49 +0000 (17:27 -0700)
committerMatthew Fernandez <matthew.fernandez@gmail.com>
Mon, 10 Oct 2022 14:59:07 +0000 (07:59 -0700)
Gitlab: #1950

tclpkg/tcldot/tcldot-graphcmd.c

index f858b3e66a5d9d27c2394f5eddb47fa507a0f8fc..85b463c27b9222b98e1673753557b5c69bd21f67 100644 (file)
@@ -108,12 +108,12 @@ int graphcmd(ClientData clientData, Tcl_Interp * interp,
        return TCL_OK;
 
     } else if (strcmp("countnodes", argv[1]) == 0) {
-       sprintf(buf, "%d", agnnodes(g));
+       snprintf(buf, sizeof(buf), "%d", agnnodes(g));
        Tcl_AppendResult(interp, buf, NULL);
        return TCL_OK;
 
     } else if (strcmp("countedges", argv[1]) == 0) {
-       sprintf(buf, "%d", agnedges(g));
+       snprintf(buf, sizeof(buf), "%d", agnedges(g));
        Tcl_AppendResult(interp, buf, NULL);
        return TCL_OK;