Fix bug in print_for_human

This commit is contained in:
Arti Zirk 2016-09-26 19:56:46 +03:00
parent a7a915faf4
commit a882534979

View File

@ -14,7 +14,7 @@ int print_ascii_tbl (FILE *stream) {
int print_for_human (FILE *stream, const unsigned char *array, const int len) { int print_for_human (FILE *stream, const unsigned char *array, const int len) {
for (int i = 0; i < len; i++) { for (int i = 0; i < len; i++) {
if (array[i] >= ' ' && array[i] <= '~') { if (array[i] >= ' ' && array[i] <= '~') {
if(!fprintf(stream, "%c ", array[i])) { if(!fprintf(stream, "%c", array[i])) {
return 0; return 0;
} }
} else { } else {
@ -23,5 +23,5 @@ int print_for_human (FILE *stream, const unsigned char *array, const int len) {
} }
} }
} }
return 0; return fprintf(stream, "\n");;
} }