summaryrefslogtreecommitdiff
path: root/H64E-2/h64e.c
diff options
context:
space:
mode:
authordianshi <dianshi@main.lv>2020-03-23 16:56:25 +0000
committerdianshi <dianshi@main.lv>2020-03-23 16:56:25 +0000
commit248bbd7aec91f03cfe35fdfb707be510381bbbfa (patch)
tree285317f9667dd652003653a5cdc899895a24ee8c /H64E-2/h64e.c
parent6abd917945951cb1971fccdd649ee7f59050813c (diff)
downloadH64D-2-248bbd7aec91f03cfe35fdfb707be510381bbbfa.tar.gz
H64D-2-248bbd7aec91f03cfe35fdfb707be510381bbbfa.zip
Compilable on linux
Diffstat (limited to 'H64E-2/h64e.c')
-rw-r--r--H64E-2/h64e.c39
1 files changed, 24 insertions, 15 deletions
diff --git a/H64E-2/h64e.c b/H64E-2/h64e.c
index 35875a2..a508fd3 100644
--- a/H64E-2/h64e.c
+++ b/H64E-2/h64e.c
@@ -221,6 +221,15 @@ int h64e_fmt_byte_align16(H64E_format *fs, uint8_t *in_data, int32_t in_size, ui
buf1_sz += 1;
}
}
+ if (fs->f_output_types)
+ {
+ if (fs->output_fmt == H64E_O_INT8)
+ {
+ buf2_sz = snprintf((char *)&buf2[0], BUF_SZ, "%4d ", (int8_t)in_data[i]);
+ } else if (fs->output_fmt == H64E_O_UINT8) {
+ buf2_sz = snprintf((char *)&buf2[0], BUF_SZ, "%4u ", (uint8_t)in_data[i]);
+ }
+ }
} else {
printf("Empty spaces\n");
@@ -241,24 +250,24 @@ int h64e_fmt_byte_align16(H64E_format *fs, uint8_t *in_data, int32_t in_size, ui
}
}
}
- //count converted chars per line
- fs->column_pos += 1;
- fs->total_output += 1;
+ //count converted chars per line
+ fs->column_pos += 1;
+ fs->total_output += 1;
- if (fs->column_pos == fs->column_size)
- {
- if (fs->f_new_line) {
- //set triger to newline
- fs->t_new_line = 1;
- fs->column_pos = 0;
- //set new line to buffer
- if (buf1_sz+1<BUF_SZ)
- {
- buf1[buf1_sz] = '\n';
- buf1_sz += 1;
- }
+ if (fs->column_pos == fs->column_size)
+ {
+ if (fs->f_new_line) {
+ //set triger to newline
+ fs->t_new_line = 1;
+ fs->column_pos = 0;
+ //set new line to buffer
+ if (buf1_sz+1<BUF_SZ)
+ {
+ buf1[buf1_sz] = '\n';
+ buf1_sz += 1;
}
}
+ }
//copy data to buffer after each iteration