Subject: Re: i386 build fails at running fc-cache
To: None <current-users@NetBSD.org>
From: Aidan Kehoe <kehoea@parhasard.net>
List: current-users
Date: 02/02/2004 13:07:33
Ar an 2ú lá de mí 2, scríobh Aidan Kehoe :
> Yeah. The off-by-two bug is a seperate issue.
Ah, but I'm wrong. The original code was the below;
if (*s == '~')
{
FcChar8 *home = (FcChar8 *) getenv ("HOME");
int size = strlen ((char *) home) + strlen ((char *) s);
if (!home)
return 0;
new = (FcChar8 *) malloc (size);
if (!new)
return 0;
FcMemAlloc (FC_MEM_STRING, size);
strcpy ((char *) new, (char *) home);
strcat ((char *) new, (char *) s + 1);
}
Since strlen(s) includes the '~' in its count, and the string that is copied
into new doesn't include the '~', there's no need to add the one.
--
I don't care if it rains or freezes/'Long as I got my Plastic Jesus
Riding on the dashboard of my car.