Project

General

Profile

Bug #98 ยป 0001-bug-98.patch

Gurvinder Singh, 02/18/2010 02:32 AM

View differences:

src/util-print.c
void PrintRawUriFp(FILE *fp, uint8_t *buf, uint32_t buflen) {
uint32_t u;
uint8_t buftemp[buflen+1] /* for '\0' character */;
char temp[2];
for (u = 0; u < buflen; u++) {
if (isprint(buf[u])) fprintf(fp, "%c", buf[u]);
else fprintf(fp, "\\x%02X", buf[u]);
if (isprint(buf[u])) {
buftemp[u] = buf[u];
} else {
snprintf(temp, sizeof(temp), "\\x%02X", buf[u]);
buftemp[u] = temp[0];
}
}
buftemp[u] = '\0';
fprintf(fp, "%s", buftemp);
}
void PrintRawDataFp(FILE *fp, uint8_t *buf, uint32_t buflen) {
    (1-1/1)