9fans archive / 1995 / 11 / 34 / prev next
From: Sandy Harris sharris@fox...
Subject: acme buglet
Date: Sat, 4 Nov 1995 02:03:03 -0500
Scott Schwartz <schwartz@gal...> wrote:
>Rob sent me a different patch for that bug. Here it is.
>
>fix in util.l:
>
>byte*
>runetobyte(Rune *r, int n)
>{
> byte *s;
>
>> if(n == 0)
>> return nil;
> s = malloc(n*UTFmax+1);
> snprint(s, n*UTFmax+1, "%.*S", n, r);
> return s;
>}
What does this do if the malloc() fails?
--
Sandy Harris
sharris@fox...