summaryrefslogtreecommitdiffstats
path: root/fbench
diff options
context:
space:
mode:
authorTor Egge <Tor.Egge@online.no>2023-01-31 12:46:10 +0100
committerTor Egge <Tor.Egge@online.no>2023-01-31 12:46:10 +0100
commit8dca74eb0879fe0e530c783d74a355747422aeec (patch)
tree1558b0d553400bf7a4e14ec01e82358ba8cfd1fd /fbench
parent82e48e07e3d93521dfc53993a30d7f25ded4a440 (diff)
Use snprintf instead of sprintf.
Diffstat (limited to 'fbench')
-rw-r--r--fbench/src/fbench/client.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/fbench/src/fbench/client.cpp b/fbench/src/fbench/client.cpp
index 5c064159c65..e058ded2195 100644
--- a/fbench/src/fbench/client.cpp
+++ b/fbench/src/fbench/client.cpp
@@ -251,8 +251,9 @@ Client::run()
strlen("\nFBENCH: URL FETCH FAILED!\n"));
_output->write(&FBENCH_DELIMITER[1], strlen(FBENCH_DELIMITER) - 1);
} else {
- sprintf(timestr, "\nTIME USED: %0.4f s\n",
- _reqTimer->GetTimespan() / 1000.0);
+ snprintf(timestr, sizeof(timestr),
+ "\nTIME USED: %0.4f s\n",
+ _reqTimer->GetTimespan() / 1000.0);
_output->write(timestr, strlen(timestr));
_output->write(&FBENCH_DELIMITER[1], strlen(FBENCH_DELIMITER) - 1);
}