diff options
author | pgen <p.gen.progs@gmail.com> | 2024-01-20 20:07:53 +0100 |
---|---|---|
committer | pgen <p.gen.progs@gmail.com> | 2024-01-20 20:09:00 +0100 |
commit | 0ed7710955e3dfe99b9447b33993488d0d90645c (patch) | |
tree | 743a312ba5df79fc25944c8040dc878424a2383f | |
parent | 9626f39277511aa59b0324113989445c312a9148 (diff) |
[utils.c] Comment the hexdump function
Fix also a compiler warning.
-rw-r--r-- | utils.c | 11 |
1 files changed, 10 insertions, 1 deletions
@@ -11,6 +11,7 @@ /* ******************************** */ #include "config.h" +#include <stddef.h> #include <stdio.h> #include <stdlib.h> #include <limits.h> @@ -399,12 +400,20 @@ strprint(char const *s) } } - if (p - new > l) + if (p - new > (ptrdiff_t)l) new = xrealloc(new, p - new + 1); return new; } +/* =============================================== */ +/* Hexadecimal dump of part of a buffer to a file. */ +/* */ +/* buf : buffer to dump. */ +/* fp : file to dump to. */ +/* prefix: string to be printed before each line. */ +/* size : length of the buffer to consider. */ +/* =============================================== */ void hexdump(const char *buf, FILE *fp, const char *prefix, size_t size) { |