[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Tinycc-devel] Fix for Microsoft compilers
From: |
oldfaber |
Subject: |
Re: [Tinycc-devel] Fix for Microsoft compilers |
Date: |
Sun, 12 Apr 2015 15:10:14 +0200 |
> Except that later there is "name = buf;" with name staying live out of this if
> scope. So this change is not correct. It would be better to move it out up a
> bit.
>
> Best regards,
>
> Thomas
Yes, you are right, the patch is wrong.
What about removing char buf[32] and replacing
strcpy(buf, "__bound_");
strcat(buf, name);
name = buf;
with
if (strlen(name) + strlen("__bound_") <
(unsigned)STRING_MAX_SIZE) {
memmove(name + strlen("__bound_"), name, strlen(name));
memcpy(name, "__bound_", strlen("__bound_"));
}
Is it overkill ?
Regards
Fabio