[Spice-devel] [cacard 2/5] hex_dump: Mark source data as const

Christophe Fergeau cfergeau at redhat.com
Tue Aug 21 15:03:55 UTC 2018


hex_dump() is not going to modify it.

Signed-off-by: Christophe Fergeau <cfergeau at redhat.com>
---
 src/common.c | 2 +-
 src/common.h | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/common.c b/src/common.c
index 6f835df..0e90b0e 100644
--- a/src/common.c
+++ b/src/common.c
@@ -56,7 +56,7 @@ static char hexdump_buffer[5*MAX_STATIC_BYTES];
  * can hold up to 1024 bytes (longer will get truncated).
  */
 char *
-hex_dump(unsigned char *buf, size_t buflen)
+hex_dump(const unsigned char *buf, size_t buflen)
 {
     char *p, *start;
     size_t i;
diff --git a/src/common.h b/src/common.h
index 0336273..5210367 100644
--- a/src/common.h
+++ b/src/common.h
@@ -29,6 +29,6 @@
 unsigned char *ushort2lebytes(unsigned char *buf, unsigned short x);
 unsigned short lebytes2ushort(const unsigned char *buf);
 
-char *hex_dump(unsigned char *buf, size_t buflen);
+char *hex_dump(const unsigned char *buf, size_t buflen);
 
 #endif
-- 
2.17.1



More information about the Spice-devel mailing list