Skip to content

Commit a16c8a9

Browse files
committed
remove sprintf() depreciation warning
1 parent b5bce70 commit a16c8a9

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/simulation/environment/spiceInterface/spiceInterface.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ SpiceInterface::SpiceInterface()
5252

5353
//! - set default epoch time information
5454
char string[255];
55-
sprintf(string, "%4d/%02d/%02d, %02d:%02d:%04.1f (UTC)", EPOCH_YEAR, EPOCH_MONTH, EPOCH_DAY, EPOCH_HOUR, EPOCH_MIN, EPOCH_SEC);
55+
snprintf(string, 255, "%4d/%02d/%02d, %02d:%02d:%04.1f (UTC)", EPOCH_YEAR, EPOCH_MONTH, EPOCH_DAY, EPOCH_HOUR, EPOCH_MIN, EPOCH_SEC);
5656
this->UTCCalInit = string;
5757

5858
return;
@@ -173,7 +173,7 @@ void SpiceInterface::initTimeData()
173173
} else {
174174
// Set the epoch information from the input message
175175
char string[255];
176-
sprintf(string, "%4d/%02d/%02d, %02d:%02d:%04.1f (UTC)", epochMsg.year, epochMsg.month, epochMsg.day, epochMsg.hours, epochMsg.minutes, epochMsg.seconds);
176+
snprintf(string, 255, "%4d/%02d/%02d, %02d:%02d:%04.1f (UTC)", epochMsg.year, epochMsg.month, epochMsg.day, epochMsg.hours, epochMsg.minutes, epochMsg.seconds);
177177
this->UTCCalInit = string;
178178
}
179179
}

0 commit comments

Comments
 (0)