From b705d3b2ad09abaee40adcbeb795129eb6958c13 Mon Sep 17 00:00:00 2001 From: Matthew Fernandez Date: Wed, 7 Sep 2022 17:27:49 -0700 Subject: [PATCH] tclpkg graphcmd: remove some uses of bare 'sprintf' Gitlab: #1950 --- tclpkg/tcldot/tcldot-graphcmd.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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; -- 2.40.0