fix a bug in the ={par({...})} function.

The replacement did not happen correctly.
This commit is contained in:
Holger Vogt 2024-03-29 17:19:48 +01:00
parent ee39b2600b
commit e561249e9b
1 changed files with 5 additions and 3 deletions

View File

@ -6596,11 +6596,13 @@ static void inp_compat(struct card *card)
// skip '='
cut_line++;
// copy the replacement without trailing '\0'
for (ii = 0; ii < xlen; ii++)
char* loc_ptr = str_ptr - 1;
for (ii = 0; ii < xlen; ii++) {
if (*copy_ptr)
*cut_line++ = *copy_ptr++;
*loc_ptr++ = *copy_ptr++;
else
*cut_line++ = ' ';
*loc_ptr++ = ' ';
}
tfree(del_ptr);
tfree(exp_ptr);