Fixed issue with clang complaining about sprintf being depreciated

This commit is contained in:
slinky55
2022-09-30 00:34:33 -04:00
parent 4b65d65af3
commit e2e45f7a14
6 changed files with 9 additions and 9 deletions

View File

@@ -224,7 +224,7 @@ bool OpenDDLExport::writeValueType(Value::ValueType type, size_t numItems, std::
statement += "[";
char buffer[256];
::memset(buffer, '\0', 256 * sizeof(char));
sprintf(buffer, "%d", static_cast<int>(numItems));
snprintf(buffer, 256, "%d", static_cast<int>(numItems));
statement += buffer;
statement += "]";
}
@@ -255,7 +255,7 @@ bool OpenDDLExport::writeValue(Value *val, std::string &statement) {
std::stringstream stream;
char buffer[256];
::memset(buffer, '\0', 256 * sizeof(char));
sprintf(buffer, "%d", val->getInt16());
snprintf(buffer, 256, "%d", val->getInt16());
statement += buffer;
} break;
case Value::ValueType::ddl_int32: {
@@ -263,7 +263,7 @@ bool OpenDDLExport::writeValue(Value *val, std::string &statement) {
char buffer[256];
::memset(buffer, '\0', 256 * sizeof(char));
const int i = static_cast<int>(val->getInt32());
sprintf(buffer, "%d", i);
snprintf(buffer, 256, "%d", i);
statement += buffer;
} break;
case Value::ValueType::ddl_int64: {