Mercurial > libavutil.hg
comparison avstring.h @ 778:81aecbb6bbb2 libavutil
Add warnings to av_strlcat and av_strlcpy doxygen that the input strings
already must be properly 0-terminated strings. Unlike strncpy it
cannot be used on raw data read from a file.
| author | reimar |
|---|---|
| date | Wed, 09 Sep 2009 21:00:51 +0000 |
| parents | 683a6dbdd2b2 |
| children | cb32a271f4cd |
comparison
equal
deleted
inserted
replaced
| 777:9b87c6b537bb | 778:81aecbb6bbb2 |
|---|---|
| 54 * | 54 * |
| 55 * @param dst destination buffer | 55 * @param dst destination buffer |
| 56 * @param src source string | 56 * @param src source string |
| 57 * @param size size of destination buffer | 57 * @param size size of destination buffer |
| 58 * @return the length of src | 58 * @return the length of src |
| 59 * | |
| 60 * WARNING: since the return value is the length of src, src absolutely | |
| 61 * _must_ be a properly 0-terminated string, otherwise this will read beyond | |
| 62 * the end of the buffer and possibly crash. | |
| 59 */ | 63 */ |
| 60 size_t av_strlcpy(char *dst, const char *src, size_t size); | 64 size_t av_strlcpy(char *dst, const char *src, size_t size); |
| 61 | 65 |
| 62 /** | 66 /** |
| 63 * Append the string src to the string dst, but to a total length of | 67 * Append the string src to the string dst, but to a total length of |
| 68 * | 72 * |
| 69 * @param dst destination buffer | 73 * @param dst destination buffer |
| 70 * @param src source string | 74 * @param src source string |
| 71 * @param size size of destination buffer | 75 * @param size size of destination buffer |
| 72 * @return the total length of src and dst | 76 * @return the total length of src and dst |
| 77 * | |
| 78 * WARNING: since the return value use the length of src and dst, these absolutely | |
| 79 * _must_ be a properly 0-terminated strings, otherwise this will read beyond | |
| 80 * the end of the buffer and possibly crash. | |
| 73 */ | 81 */ |
| 74 size_t av_strlcat(char *dst, const char *src, size_t size); | 82 size_t av_strlcat(char *dst, const char *src, size_t size); |
| 75 | 83 |
| 76 /** | 84 /** |
| 77 * Append output to a string, according to a format. Never write out of | 85 * Append output to a string, according to a format. Never write out of |
