1
0
Fork 0

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
1 changed files with 2 additions and 2 deletions

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