bydgoszcz

simple, fast and efficient programming language
git clone git://git.kocotian.pl/bydgoszczscript.git
Log | Files | Refs | README | LICENSE

commit 72c27530a68811c8581a8b379cab45e27fff37d1
parent 58e085c3230c3de9d34c09904bdc210f60c8ab37
Author: kocotian <kocotian@kocotian.pl>
Date:   Fri, 28 May 2021 13:26:15 +0200

Type fixes

Diffstat:
Mcompile.c | 14+++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/compile.c b/compile.c @@ -172,20 +172,20 @@ g_type(File *f, TypeString *str) } str->len = (size_t)(*(str->data) = 0); if (isptrconst && ptrlvl) - strncat(str->data, "const ", MAX_TYPESIZE); + str->len = strlen(strncat(str->data, "const ", MAX_TYPESIZE - str->len)); if (isunsigned == 1) - strncat(str->data, "unsigned ", MAX_TYPESIZE); + str->len = strlen(strncat(str->data, "unsigned ", MAX_TYPESIZE - str->len)); else if (isunsigned == 2) - strncat(str->data, "signed ", MAX_TYPESIZE); + str->len = strlen(strncat(str->data, "signed ", MAX_TYPESIZE - str->len)); if (isshort) - strncat(str->data, "short ", MAX_TYPESIZE); + str->len = strlen(strncat(str->data, "short ", MAX_TYPESIZE - str->len)); else if (islong) - strncat(str->data, "long ", MAX_TYPESIZE); - str->len = strlen(str->data); + str->len = strlen(strncat(str->data, "long ", MAX_TYPESIZE - str->len)); - strncpy(str->data + str->len, + strncat(str->data, name.data, UMIN(MAX_TYPESIZE - str->len, name.len)); + str->len += name.len; while (ptrlvl > 0 && ptrlvl--)