From e38eaf47491a864b2180d1ade87ed0ef39dd6d34 Mon Sep 17 00:00:00 2001 From: Andreas Rheinhardt Date: Sun, 5 Dec 2021 18:52:29 +0100 Subject: avformat/utils: Make ff_data_to_hex() zero-terminate the string Most callers want it that way anyway. Signed-off-by: Andreas Rheinhardt --- libavformat/internal.h | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'libavformat/internal.h') diff --git a/libavformat/internal.h b/libavformat/internal.h index 20e93d9267..f43e408548 100644 --- a/libavformat/internal.h +++ b/libavformat/internal.h @@ -484,6 +484,17 @@ void ff_flush_packet_queue(AVFormatContext *s); */ int ff_mkdir_p(const char *path); +/** + * Write hexadecimal string corresponding to given binary data. The string + * is zero-terminated. + * + * @param buf the output string is written here; + * needs to be at least 2 * size + 1 bytes long. + * @param src the input data to be transformed. + * @param size the size (in byte) of src. + * @param lowercase determines whether to use the range [0-9a-f] or [0-9A-F]. + * @return buf. + */ char *ff_data_to_hex(char *buf, const uint8_t *src, int size, int lowercase); /** -- cgit v1.2.3