Skip to content

Commit

Permalink
fix: remove strndup
Browse files Browse the repository at this point in the history
  • Loading branch information
bmax committed Mar 5, 2024
1 parent 971ade9 commit 14e417e
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion tools/patch.c
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,11 @@ void print_preset_info(preset_t *preset)
while (pos < setup->additional + ADDITIONAL_LEN) {
int len = *pos;
if (!len) break;
fprintf(stdout, "%s\n", strndup(++pos, len));
pos++;
char backup = *(pos + len);
*(pos + len) = 0;
fprintf(stdout, "%s\n", pos);
*(pos + len) = backup;
pos += len;
}
}
Expand Down

0 comments on commit 14e417e

Please sign in to comment.