<html><head></head><body>Wrong format specifier, should be hhu, and invalid removal of const.<br><br><div class="gmail_quote">Le 8 avril 2020 01:04:18 GMT+03:00, Marvin Scholz <epirat07@gmail.com> a écrit :<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<pre class="k9mail"><hr> include/vlc_strings.h | 12 ++++++++++++<br> src/libvlccore.sym | 1 +<br> src/text/strings.c | 10 ++++++++++<br> 3 files changed, 23 insertions(+)<br><br>diff --git a/include/vlc_strings.h b/include/vlc_strings.h<br>index 411f4a8ceb..e229b32d5d 100644<br>--- a/include/vlc_strings.h<br>+++ b/include/vlc_strings.h<br>@@ -118,6 +118,18 @@ VLC_API void vlc_xml_decode(char *st);<br> */<br> VLC_API char *vlc_xml_encode(const char *str) VLC_MALLOC;<br> <br>+/**<br>+ * Encode binary data as hex string<br>+ * <br>+ * Writes a given data buffer to the output buffer as a null terminated<br>+ * string in hexadecimal representation.<br>+ * <br>+ * \param input Input buffer<br>+ * \param size Input buffer size<br>+ * \param[out] output Output buffer to write the string to<br>+ */<br>+VLC_API void vlc_hex_encode_binary(const void *input, size_t size, char *output);<br>+<br> /**<br> * Base64 encoding.<br> *<br>diff --git a/src/libvlccore.sym b/src/libvlccore.sym<br>index cc8098edd9..17561db932 100644<br>--- a/src/libvlccore.sym<br>+++ b/src/libvlccore.sym<br>@@ -483,6 +483,7 @@ vlc_b64_decode_binary<br> vlc_b64_decode_binary_to_buffer<br> vlc_b64_encode<br> vlc_b64_encode_binary<br>+vlc_hex_encode_binary<br> vlc_cancel<br> vlc_clone<br> VLC_CompileBy<br>diff --git a/src/text/strings.c b/src/text/strings.c<br>index 658249f890..5180f16a83 100644<br>--- a/src/text/strings.c<br>+++ b/src/text/strings.c<br>@@ -346,6 +346,16 @@ char *vlc_xml_encode (const char *str)<br> return stream.ptr;<br> }<br> <br>+/* Hex encoding */<br>+void vlc_hex_encode_binary(const void *input, size_t size, char *output)<br>+{<br>+ unsigned char *buffer = input;<br>+<br>+ for (size_t i = 0; i < size; i++) {<br>+ sprintf(&output[i * 2], "%02" PRIx8, buffer[i]);<br>+ }<br>+}<br>+<br> /* Base64 encoding */<br> char *vlc_b64_encode_binary(const void *src, size_t length)<br> {</pre></blockquote></div><br>-- <br>Envoyé de mon appareil Android avec Courriel K-9 Mail. Veuillez excuser ma brièveté.</body></html>