use alloca+memcpy instead of strdupa.

for these guys that insist in using doomed systems like solaris or
bsd, god save them ;-)

Patch by vtorri.


SVN revision: 40491
This commit is contained in:
Gustavo Sverzut Barbieri 2009-05-02 23:22:07 +00:00
parent 96511aeea4
commit e09dc2a71c
1 changed files with 8 additions and 2 deletions

View File

@ -822,14 +822,20 @@ _edje_emit(Edje *ed, const char *sig, const char *src)
sep = strchr(sig, ':');
if (sep)
{
size_t length;
char *part;
/* the signal contains a colon, split the signal into "group:signal",
* and deliver it to "group"
*/
char *part = strdupa(sig);
length = strlen(sig) + 1;
part = alloca(length);
if (part)
{
char *newsig = part + (sep - sig);
char *newsig;
int i;
memcpy(part, sig, length);
newsig = part + (sep - sig);
*newsig = '\0';
newsig++;