From 2ffd4e4f1af16b17a286ff354603a717f5d828a5 Mon Sep 17 00:00:00 2001 From: ManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com> Date: Mon, 26 Sep 2022 16:12:18 +0200 Subject: Replace all calls to sprintf() by calls to snprintf(). --- test/tree.fl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'test/tree.fl') diff --git a/test/tree.fl b/test/tree.fl index d44d4c08b..ea068a5c8 100644 --- a/test/tree.fl +++ b/test/tree.fl @@ -270,7 +270,7 @@ tree->add("Long Line/Longer Line/The quick brown fox jumped over the lazy dog. - // Add 500 items in numerical order for ( int t=0; t<500; t++ ) { static char s[80]; - sprintf(s, "500 Items/item %04d", t+1); + snprintf(s, 80, "500 Items/item %04d", t+1); tree->add(s); } tree->close("500 Items"); // close the 500 items by default @@ -986,7 +986,7 @@ while (item) { if ( parent == 0 ) parent = tree->root(); char s[80]; for ( int i=0; i<20000; i++ ) { - sprintf(s, "Item \#%d", item_id+i); + snprintf(s, 80, "Item \#%d", item_id+i); tree->add(parent, s); } item_id += 20000; -- cgit v1.2.3