in v2/src/log_context_property_type_ascii_char_ptr.c [16:39]
static int ascii_char_ptr_log_context_property_type_to_string(const void* property_value, char* buffer, size_t buffer_length)
{
int result;
if (
/* Codes_SRS_LOG_CONTEXT_PROPERTY_TYPE_ASCII_CHAR_PTR_01_001: [ If property_value is NULL, LOG_CONTEXT_PROPERTY_TYPE_IF_IMPL(ascii_char_ptr).to_string shall fail and return a negative value. ]*/
(property_value == NULL) ||
/* Codes_SRS_LOG_CONTEXT_PROPERTY_TYPE_ASCII_CHAR_PTR_01_017: [ If buffer is NULL and buffer_length is greater than 0, LOG_CONTEXT_PROPERTY_TYPE_IF_IMPL(ascii_char_ptr).to_string shall fail and return a negative value. ]*/
((buffer == NULL) && (buffer_length > 0))
)
{
(void)printf("Invalid arguments: const void* property_value=%p, char* buffer=%p, size_t buffer_length=%zu\r\n",
property_value, buffer, buffer_length);
result = -1;
}
else
{
/* Codes_SRS_LOG_CONTEXT_PROPERTY_TYPE_ASCII_CHAR_PTR_01_002: [ If buffer is NULL and buffer_length is 0, LOG_CONTEXT_PROPERTY_TYPE_IF_IMPL(ascii_char_ptr).to_string shall return the length of the string pointed to by property_value. ]*/
/* Codes_SRS_LOG_CONTEXT_PROPERTY_TYPE_ASCII_CHAR_PTR_01_003: [ Otherwise, LOG_CONTEXT_PROPERTY_TYPE_IF_IMPL(ascii_char_ptr).to_string shall copy the string pointed to by property_value to buffer by using snprintf with buffer, buffer_length and format string %s and pass in the values list the const char* value pointed to be property_value. ]*/
/* Codes_SRS_LOG_CONTEXT_PROPERTY_TYPE_ASCII_CHAR_PTR_01_004: [ LOG_CONTEXT_PROPERTY_TYPE_IF_IMPL(ascii_char_ptr).to_string shall succeed and return the result of snprintf. ]*/
/* Codes_SRS_LOG_CONTEXT_PROPERTY_TYPE_ASCII_CHAR_PTR_01_005: [ If any error is encountered (truncation is not an error), LOG_CONTEXT_PROPERTY_TYPE_IF_IMPL(ascii_char_ptr).to_string shall fail and return a negative value. ]*/
result = snprintf(buffer, buffer_length, "%s", (const char*)property_value);
}
return result;
}