Function rcutils_char_array_strcat

Function Documentation

rcutils_ret_t rcutils_char_array_strcat(rcutils_char_array_t *char_array, const char *src)

Append a string to the string in buffer.

This function treats the internal buffer as a string and appends the src string to it. It is virtually equivalent to strcat(char_array->buffer, src) except that the buffer grows as needed. That is to say, a user can safely use it without doing calculation or checks on the sizes of the src and buffer.

Parameters:
  • char_array[inout] pointer to the instance of rcutils_char_array_t which is being appended to

  • src[in] the string to be appended to the end of the string in buffer

Returns:

RCUTILS_RET_OK if successful, or

Returns:

RCUTILS_RET_BAD_ALLOC if memory allocation failed, or

Returns:

RCUTILS_RET_ERROR if an unexpected error occurs.