// Print placeholders to fill out the remaining line and then optionally print the text block.
if (cell.column && cell.column < data->width) {
- const uint8_t width_missing = width_utf - width_count;
- const uint8_t column_offset = data->width - cell.column;
- width_count = 0;
+ const uint8_t width_missing = width_utf == -1 ? 0 : width_utf - width_count;
- // Handle incomplete character at the end of the stream.
- found_invalid_utf = F_true;
- invalid[character_current] = width_utf;
+ if (width_missing) {
+ const uint8_t column_offset = data->width - cell.column;
+ width_count = 0;
- if (byte_dump_print_character_fragment(data, characters, invalid, width_utf, 1, &previous, &cell, &offset) == F_true) {
- character_reset = F_true;
- }
+ // Handle incomplete character at the end of the stream.
+ found_invalid_utf = F_true;
+ invalid[character_current] = width_utf;
- if (++width_count < width_missing) {
- if (byte_dump_print_character_fragment(data, characters, invalid, width_utf, 2, &previous, &cell, &offset) == F_true) {
+ if (byte_dump_print_character_fragment(data, characters, invalid, width_utf, 1, &previous, &cell, &offset) == F_true) {
character_reset = F_true;
}
if (++width_count < width_missing) {
- if (byte_dump_print_character_fragment(data, characters, invalid, width_utf, 3, &previous, &cell, &offset) == F_true) {
+ if (byte_dump_print_character_fragment(data, characters, invalid, width_utf, 2, &previous, &cell, &offset) == F_true) {
character_reset = F_true;
}
if (++width_count < width_missing) {
- if (byte_dump_print_character_fragment(data, characters, invalid, width_utf, 4, &previous, &cell, &offset) == F_true) {
+ if (byte_dump_print_character_fragment(data, characters, invalid, width_utf, 3, &previous, &cell, &offset) == F_true) {
character_reset = F_true;
}
+
+ if (++width_count < width_missing) {
+ if (byte_dump_print_character_fragment(data, characters, invalid, width_utf, 4, &previous, &cell, &offset) == F_true) {
+ character_reset = F_true;
+ }
+ }
}
}
- }
- if (character_reset) {
- characters.used = 0;
- memset(&invalid, 0, sizeof(f_char_t) * data->width);
+ if (character_reset) {
+ characters.used = 0;
+ memset(&invalid, 0, sizeof(f_char_t) * data->width);
- previous.bytes = column_offset;
- previous.invalid = previous.bytes;
+ previous.bytes = column_offset;
+ previous.invalid = previous.bytes;
+ }
+ else {
+ previous.bytes = 0;
+ previous.invalid = 0;
+ }
}
else {
previous.bytes = 0;
previous.invalid = 0;
}
+ }
+ if (cell.column && cell.column < data->width) {
while (cell.column < data->width) {
if (data->main->parameters.array[byte_dump_parameter_unicode_e].result == f_console_result_found_e) {