X-Git-Url: https://git.wh0rd.org/?a=blobdiff_plain;f=src%2Ffcstr.c;h=4fbb1a216ea88fd551027b26d25cdea10df0cc17;hb=7d35c11b3304659d8be43913c9b125f2b5b38516;hp=3b84ac0d179dad85ad8d89aeaf0eaf4dce68d351;hpb=916640ce40b995d1d97244975139ec0c030483e4;p=fontconfig.git diff --git a/src/fcstr.c b/src/fcstr.c index 3b84ac0..4fbb1a2 100644 --- a/src/fcstr.c +++ b/src/fcstr.c @@ -710,11 +710,18 @@ FcUtf16Len (const FcChar8 *string, void FcStrBufInit (FcStrBuf *buf, FcChar8 *init, int size) { - buf->buf = init; + if (init) + { + buf->buf = init; + buf->size = size; + } else + { + buf->buf = buf->static_buf; + buf->size = sizeof (buf->static_buf); + } buf->allocated = FcFalse; buf->failed = FcFalse; buf->len = 0; - buf->size = size; } void