Bugfix/win32 build warnings (#936)
* Changed win32 port of localtime to use secure OS API functions when compiled with MSVC * Changed all the sprintf to use snprintf instead in BSC tests to ensure null string endings.
This commit is contained in:
@@ -467,16 +467,16 @@ bool bacnet_discover_property_name(
|
||||
device_id, object_type, object_instance, object_property, &value);
|
||||
if (status && value.tag == BACNET_APPLICATION_TAG_CHARACTER_STRING) {
|
||||
if (characterstring_valid(&value.type.Character_String)) {
|
||||
strncpy(
|
||||
buffer, characterstring_value(&value.type.Character_String),
|
||||
buffer_len - 1);
|
||||
snprintf(
|
||||
buffer, buffer_len, "%s",
|
||||
characterstring_value(&value.type.Character_String));
|
||||
} else {
|
||||
status = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!status) {
|
||||
strncpy(buffer, default_string, buffer_len);
|
||||
snprintf(buffer, buffer_len, "%s", default_string);
|
||||
}
|
||||
|
||||
return status;
|
||||
|
||||
Reference in New Issue
Block a user