The X9.31 Sample Program

326 RSA BSAFE Crypto-C Developers Guide

Printing the Buffer Contents

The following procedure prints the current contents of the buffer.

/* This procedure will print out whats in the buffer.
*/
void PrintBuf (buffer, bufferLen)
unsigned char *buffer;
unsigned int bufferLen;
{
unsigned int i;
for (i = 0; i < bufferLen; ++i) {
if ( ((i & 7) == 7) || (i == (bufferLen - 1)) )
printf (" %02x\n", buffer[i]);
else
printf (" %02x", buffer[i]);
}
printf ("\n");
} /* end PrintBuf */