/* * util.c * * Created on: Aug 12, 2009 * Author: johan */ // adapted from libgomspace #include #include #include "common_utils/hexdump.h" //! Dump memory to debugging output /** * Dumps a chunk of memory to the screen */ void hex_dump(FILE * fp, void *src, int len) { int i, j=0, k; char text[17]; text[16] = '\0'; //printf("Hex dump:\r\n"); fprintf(fp, "%p : ", src); for(i=0; i 126)) { text[k] = '.'; } } fprintf(fp, " |%s|\n\r", text); if(i= 32 && line[i] <= 126) fprintf(fp, "%c", (unsigned char)line[i]); else fputc('.', fp); } fputs("|\r\n", fp); }