diff options
author | Matt Jordan <mjordan@digium.com> | 2015-07-17 08:51:04 -0500 |
---|---|---|
committer | Gerrit Code Review <gerrit2@gerrit.digium.api> | 2015-07-17 08:51:04 -0500 |
commit | f90beeaea6269386d6daf041f6d1a9a953f15de1 (patch) | |
tree | e168f232a7064ffc1e83da69c9e7880ea881ccb0 /include/asterisk | |
parent | daf284944b8b0b78f2c073e15dd73c3108f061f9 (diff) | |
parent | b34c4528abfff6759fe184adc6360a0e22705e2c (diff) |
Merge "strings.h: Fix issues with escape string functions."
Diffstat (limited to 'include/asterisk')
-rw-r--r-- | include/asterisk/strings.h | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/include/asterisk/strings.h b/include/asterisk/strings.h index d361293d0..af5ae6c55 100644 --- a/include/asterisk/strings.h +++ b/include/asterisk/strings.h @@ -312,32 +312,33 @@ char *ast_unescape_c(char *s); /*! * \brief Escape the 'to_escape' characters in the given string. * - * \note The given output buffer has to have enough memory allocated to store the - * original string plus any escaped values. + * \note The given output buffer will contain a truncated escaped + * version of the source string if the given buffer is not large + * enough. * * \param dest the escaped string * \param s the source string to escape - * \param num number of characters to be copied from the source + * \param size The size of the destination buffer * \param to_escape an array of characters to escape * * \return Pointer to the destination. */ -char* ast_escape(char *dest, const char *s, size_t num, const char *to_escape); +char *ast_escape(char *dest, const char *s, size_t size, const char *to_escape); /*! * \brief Escape standard 'C' sequences in the given string. * - * \note The given output buffer has to have enough memory allocated to store the - * original string plus any escaped values. + * \note The given output buffer will contain a truncated escaped + * version of the source string if the given buffer is not large + * enough. * * \param dest the escaped string * \param s the source string to escape - * \param num number of characters to be copied from the source - * \param to_escape an array of characters to escape + * \param size The size of the destination buffer * * \return Pointer to the escaped string. */ -char* ast_escape_c(char *dest, const char *s, size_t num); +char *ast_escape_c(char *dest, const char *s, size_t size); /*! * \brief Escape the 'to_escape' characters in the given string. |