tUse snprintf over sprintf - sphere - GPU-based 3D discrete element method algorithm with optional fluid coupling
HTML git clone git://src.adamsgaard.dk/sphere
DIR Log
DIR Files
DIR Refs
DIR LICENSE
---
DIR commit bdb204c145d7bea5a57b05df8bb161ac5684a80f
DIR parent c4ee06baa5b3cae0895a35a082579351582b26fd
HTML Author: Anders Damsgaard <anders@adamsgaard.dk>
Date: Mon, 2 Sep 2019 10:50:29 +0200
Use snprintf over sprintf
Diffstat:
M src/device.cu | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
---
DIR diff --git a/src/device.cu b/src/device.cu
t@@ -2619,8 +2619,8 @@ void DEM::startTime()
// Write binary output file
time.step_count += 1;
- sprintf(file,"output/%s.output%05d.bin", sid.c_str(),
- time.step_count);
+ snprintf(file, sizeof(file), "output/%s.output%05d.bin",
+ sid.c_str(), time.step_count);
writebin(file);
/*std::cout