should not change the output; avoids an additional printf()
for the separator.
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19570>
#include "sha1/sha1.h"
#include "mesa-sha1.h"
#include <string.h>
+#include <inttypes.h>
void
_mesa_sha1_compute(const void *data, size_t size, unsigned char result[20])
sha1_to_uint32(sha1, u32);
for (unsigned i = 0; i < SHA1_DIGEST_LENGTH32; i++) {
- fprintf(f, "0x%08x", u32[i]);
- if (i < SHA1_DIGEST_LENGTH32 - 1)
- fprintf(f, ", ");
+ fprintf(f, i ? ", 0x%08" PRIx32 : "0x%08" PRIx32, u32[i]);
}
}