Fix bug where tabpos data was not properly initialized in tools/expand_tabs_into()

This commit is contained in:
Thomas Jensen 2021-03-13 16:43:56 +01:00
parent b38e8f527b
commit e106e1412a
No known key found for this signature in database
GPG Key ID: A4ACEE270D0FB7DB

View File

@ -268,13 +268,13 @@ size_t expand_tabs_into(const uint32_t *input_buffer, const int tabstop, uint32_
size_t tabnum = 0; /* index of the current tab */
*text = NULL;
*tabpos = NULL;
*tabpos_len = 0;
if (opt.tabexp != 'k') {
if (opt.tabexp == 'k') {
/* We need to know the exact tab positions only if expansion type 'k' is requested (keep tabs as much as they
* were as possible). Else we'll just convert spaces and tabs without having to know where exactly the tabs
* were in the first place. */
*tabpos_len = 0;
} else {
ucs4_t puc;
const uint32_t *rest = input_buffer;
while ((rest = u32_next(&puc, rest))) {