X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=src%2Ficu_utf16.c;h=65298c255b20643580e6d6ff6c8f5a2f9790ac75;hb=dbc40ad16aa82379d2884e106d79c7d83312667a;hp=c5970ef6b8f2148e5cc2458e1532d57efbe5d62f;hpb=43a9d38d20c1b1bcd1a03b2445a501d27526bd35;p=yaz-moved-to-github.git diff --git a/src/icu_utf16.c b/src/icu_utf16.c index c5970ef..65298c2 100644 --- a/src/icu_utf16.c +++ b/src/icu_utf16.c @@ -1,5 +1,5 @@ /* This file is part of the YAZ toolkit. - * Copyright (C) 1995-2011 Index Data + * Copyright (C) 1995-2013 Index Data * See the file LICENSE for details. */ @@ -28,7 +28,7 @@ struct icu_buf_utf16 * icu_buf_utf16_create(size_t capacity) { - struct icu_buf_utf16 * buf16 + struct icu_buf_utf16 * buf16 = (struct icu_buf_utf16 *) xmalloc(sizeof(struct icu_buf_utf16)); buf16->utf16 = 0; @@ -60,18 +60,18 @@ struct icu_buf_utf16 * icu_buf_utf16_resize(struct icu_buf_utf16 * buf16, { if (!buf16) return 0; - - if (capacity > 0) + + if (capacity > 0) { if (0 == buf16->utf16) buf16->utf16 = (UChar *) xmalloc(sizeof(UChar) * capacity); else - buf16->utf16 + buf16->utf16 = (UChar *) xrealloc(buf16->utf16, sizeof(UChar) * capacity); icu_buf_utf16_clear(buf16); buf16->utf16_cap = capacity; - } + } else { xfree(buf16->utf16); @@ -79,7 +79,6 @@ struct icu_buf_utf16 * icu_buf_utf16_resize(struct icu_buf_utf16 * buf16, buf16->utf16_len = 0; buf16->utf16_cap = 0; } - return buf16; }