tUse snprintf over sprintf - sphere - GPU-based 3D discrete element method algo… | |
git clone git://src.adamsgaard.dk/sphere | |
Log | |
Files | |
Refs | |
LICENSE | |
--- | |
commit bdb204c145d7bea5a57b05df8bb161ac5684a80f | |
parent c4ee06baa5b3cae0895a35a082579351582b26fd | |
Author: Anders Damsgaard <[email protected]> | |
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(-) | |
--- | |
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 |