Skip to content

Commit c615c0f

Browse files
committed
BUG: sprintf to snprintf + reduce CFL for tesing
1 parent ce5015b commit c615c0f

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/time.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ int Times::check_time_gate(precision_t dt_check) {
107107
void Times::calc_dt(precision_t dtNeutral,
108108
precision_t dtIon) {
109109
dt = end - current;
110-
double cfl = 0.5;
110+
double cfl = 0.1;
111111

112112
if (cfl * dtNeutral < dt)
113113
dt = cfl * dtNeutral;
@@ -230,15 +230,15 @@ void Times::increment_time() {
230230
milli = iCurrent[6];
231231

232232
char tmp[100];
233-
sprintf(tmp, "%04d%02d%02d_%02d%02d%02d",
233+
snprintf(tmp, 100, "%04d%02d%02d_%02d%02d%02d",
234234
year, month, day, hour, minute, second);
235235
sYMD_HMS = std::string(tmp);
236-
sprintf(tmp, "%04d%02d%02d_%02d%02d%02d",
236+
snprintf(tmp, 100, "%04d%02d%02d_%02d%02d%02d",
237237
year, month, day, hour, minute, 0);
238238
sYMD_HM0 = std::string(tmp);
239-
sprintf(tmp, "%04d%02d%02d", year, month, day);
239+
snprintf(tmp, 100, "%04d%02d%02d", year, month, day);
240240
sYMD = std::string(tmp);
241-
sprintf(tmp, "%02d%02d%02d", hour, minute, second);
241+
snprintf(tmp, 100, "%02d%02d%02d", hour, minute, second);
242242
sHMS = std::string(tmp);
243243

244244
// Calculate Julian Day (day of year):

0 commit comments

Comments
 (0)