From: Matthew Fernandez Date: Thu, 8 Sep 2022 00:27:49 +0000 (-0700) Subject: tclpkg graphcmd: remove some uses of bare 'sprintf' X-Git-Tag: 6.0.2~7^2~1 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=b705d3b2ad09abaee40adcbeb795129eb6958c13;p=graphviz tclpkg graphcmd: remove some uses of bare 'sprintf' Gitlab: #1950 --- diff --git a/tclpkg/tcldot/tcldot-graphcmd.c b/tclpkg/tcldot/tcldot-graphcmd.c index f858b3e66..85b463c27 100644 --- a/tclpkg/tcldot/tcldot-graphcmd.c +++ b/tclpkg/tcldot/tcldot-graphcmd.c @@ -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;