bbennett-ks commented on code in PR #627: URL: https://github.com/apache/guacamole-server/pull/627#discussion_r2615430099
########## src/libguac/guacamole/string.h: ########## @@ -30,22 +30,24 @@ #include <string.h> /** - * Convert the provided unsigned integer into a string, returning the number of - * characters written into the destination string, or a negative value if an - * error occurs. + * Converts the given integer to a string safely. The resulting string will be + * written into the provided buffer, ensuring that the buffer is not exceeded. + * The conversion will fail if the buffer is too small to hold the result. * * @param dest - * The destination string to copy the data into, which should already be - * allocated and at a size that can handle the string representation of the - * inteer. + * The buffer to write the converted string into. + * + * @param dest_size + * The size of the provided buffer, in bytes. * * @param integer - * The unsigned integer to convert to a string. - * + * The integer to convert to a string. + * * @return - * The number of characters written into the dest string. + * The number of characters written (excluding the null terminator), or + * -1 if the string was truncated, or a negative value if an error occurs. Review Comment: I'll update the comment. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
