tccgen: Stop passing wrong buffer size to pstrcat in type_to_str
Some checks failed
build and test / test-x86_64-linux (push) Has been cancelled
build and test / test-x86_64-osx (push) Has been cancelled
build and test / test-aarch64-osx (push) Has been cancelled
build and test / test-x86_64-win32 (push) Has been cancelled
build and test / test-i386-win32 (push) Has been cancelled
build and test / test-arm64-win32 (push) Has been cancelled
build and test / test-armv7-linux (push) Has been cancelled
build and test / test-aarch64-linux (push) Has been cancelled
build and test / test-riscv64-linux (push) Has been cancelled
build and test / test-i386-linux (push) Has been cancelled

This commit is contained in:
Christopher Bazley 2026-09-26 22:25:07 +01:00
parent f4d81ced3e
commit 9db1105c32

View File

@ -2752,7 +2752,7 @@ static void type_to_str(char *buf, int buf_size,
pstrcat(buf1, sizeof(buf1), varstr); pstrcat(buf1, sizeof(buf1), varstr);
pstrcat(buf1, sizeof(buf1), ")"); pstrcat(buf1, sizeof(buf1), ")");
} }
pstrcat(buf1, buf_size, "("); pstrcat(buf1, sizeof(buf1), "(");
sa = s->next; sa = s->next;
while (sa != NULL) { while (sa != NULL) {
char buf2[256]; char buf2[256];
@ -2781,9 +2781,9 @@ static void type_to_str(char *buf, int buf_size,
if (t & VT_RESTRICT) if (t & VT_RESTRICT)
pstrcat(buf1, sizeof(buf1), "restrict "); pstrcat(buf1, sizeof(buf1), "restrict ");
if (t & VT_CONSTANT) if (t & VT_CONSTANT)
pstrcat(buf1, buf_size, "const "); pstrcat(buf1, sizeof(buf1), "const ");
if (t & VT_VOLATILE) if (t & VT_VOLATILE)
pstrcat(buf1, buf_size, "volatile "); pstrcat(buf1, sizeof(buf1), "volatile ");
if (varstr) if (varstr)
pstrcat(buf1, sizeof(buf1), varstr); pstrcat(buf1, sizeof(buf1), varstr);
type_to_str(buf, buf_size, &s->type, buf1); type_to_str(buf, buf_size, &s->type, buf1);