|
From: | Domingo Alvarez Duarte |
Subject: | Re: [Tinycc-devel] Small patch |
Date: | Thu, 31 Jan 2013 12:45:28 +0000 |
Le jeudi 31 janvier 2013 13:19:59, grischka a écrit :>sprintf could be used then to save some space
> > > - strcpy(buf, "__bound_");
> > > - strcat(buf, name);
> > > + snprintf(buf, sizeof(buf), "__bound_%s", name);
>
> There are cases where we might want to use "pstrcpy" instead of "strcpy".
> This is no such case because "__bound_memcpy" cannot overflow buf[32].
> Same with
> pstrcpy(buf, sizeof buf, "a.out");
> Because "a.out" cannot overflow buf[1024].
>
> --- grischka
[Prev in Thread] | Current Thread | [Next in Thread] |