Re: [BUG] Broken code in orb.c



On 23 January, 1999 - Momchil 'Velco' Velikov sent me these 1.0K bytes:

> Well, the code is just wrong ... here's a patch
[...]
> -		buf = alloca(strlen(ctmp) + sizeof("/.orbitrc"));
> -		sprintf(ctmp, "%s/.orbitrc", buf);
> +		buf = alloca(strlen(ctmp) + 9 /* strlen("/.orbitrc") */ + 1 );
> +		sprintf(buf, "%s/.orbitrc", ctmp);

Umm.. any reason to use 9 + 1 instead of sizeof("/.orbitrc") ?

Maybe even using g_strdup_printf or something..?

/Tomas
-- 
Tomas Ögren, stric@ing.umu.se, http://www.ing.umu.se/~stric/
|- Student of Computer Science at the University of Umeå
`- Sysadmin at {ing,acc}.umu.se



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]