typedef unsigned long md5_uint32;
# else
/* The following line is intended to evoke an error.
- Using #error is not portable enough. */
+ Using #error is not portable enough. */
"Cannot determine unsigned 32-bit data type."
# endif
# endif
#define OP(a, b, c, d, s, T) \
do \
- { \
+ { \
a += FF (b, c, d) + (*cwp++ = SWAP (*words)) + T; \
++words; \
CYCLIC (a, s); \
a += b; \
- } \
+ } \
while (0)
/* It is unfortunate that C does not provide an operator for
argument specifying the function to use. */
#undef OP
#define OP(f, a, b, c, d, k, s, T) \
- do \
+ do \
{ \
a += f (b, c, d) + correct_words[k] + T; \
CYCLIC (a, s); \
UNGCPRO;
md5_finish_ctx(&ctx, digest);
- for (i = 0; i < 16; i++)
- sprintf((char *)(thehash + (i * 2)), "%02x", digest[i]);
+ for (i = 0; i < 16; i++) {
+ int n = snprintf((char *)(thehash + (i * 2)), 3, "%02x", digest[i]);
+ assert(n>=0 && n < 3);
+ }
return make_string(thehash, 32);
}