@@ -179,11 +179,11 @@ self = [super init]; @try { _s = &_storage; - _s->cString = of_calloc(1, 1); + _s->cString = of_alloc_zeroed(1, 1); _s->freeWhenDone = true; } @catch (id e) { [self release]; @throw e; } @@ -245,11 +245,11 @@ cStringLength -= 3; } _s = &_storage; - _s->cString = of_malloc(cStringLength + 1, 1); + _s->cString = of_alloc(cStringLength + 1, 1); _s->cStringLength = cStringLength; _s->freeWhenDone = true; if (encoding == OF_STRING_ENCODING_UTF_8 || encoding == OF_STRING_ENCODING_ASCII) { @@ -450,11 +450,11 @@ else _s->isUTF8 = true; _s->length = string.length; - _s->cString = of_malloc(_s->cStringLength + 1, 1); + _s->cString = of_alloc(_s->cStringLength + 1, 1); memcpy(_s->cString, string.UTF8String, _s->cStringLength + 1); _s->freeWhenDone = true; } @catch (id e) { [self release]; @throw e; @@ -471,11 +471,11 @@ @try { size_t j; _s = &_storage; - _s->cString = of_malloc((length * 4) + 1, 1); + _s->cString = of_alloc((length * 4) + 1, 1); _s->length = length; _s->freeWhenDone = true; j = 0; for (size_t i = 0; i < length; i++) { @@ -527,11 +527,11 @@ } else if (byteOrder != OF_BYTE_ORDER_NATIVE) swap = true; _s = &_storage; - _s->cString = of_malloc((length * 4) + 1, 1); + _s->cString = of_alloc((length * 4) + 1, 1); _s->length = length; _s->freeWhenDone = true; j = 0; for (size_t i = 0; i < length; i++) { @@ -612,11 +612,11 @@ } else if (byteOrder != OF_BYTE_ORDER_NATIVE) swap = true; _s = &_storage; - _s->cString = of_malloc((length * 4) + 1, 1); + _s->cString = of_alloc((length * 4) + 1, 1); _s->length = length; _s->freeWhenDone = true; j = 0; for (size_t i = 0; i < length; i++) { @@ -687,11 +687,11 @@ break; case -1: @throw [OFInvalidEncodingException exception]; } - _s->cString = of_malloc(cStringLength + 1, 1); + _s->cString = of_alloc(cStringLength + 1, 1); memcpy(_s->cString, tmp, cStringLength + 1); _s->freeWhenDone = true; } @finally { free(tmp); } @@ -1153,11 +1153,11 @@ return array; } - (const of_unichar_t *)characters { - of_unichar_t *buffer = of_malloc(_s->length, sizeof(of_unichar_t)); + of_unichar_t *buffer = of_alloc(_s->length, sizeof(of_unichar_t)); size_t i = 0, j = 0; while (i < _s->cStringLength) { of_unichar_t c; ssize_t cLen; @@ -1180,11 +1180,11 @@ freeWhenDone: true] items]; } - (const of_char32_t *)UTF32StringWithByteOrder: (of_byte_order_t)byteOrder { - of_char32_t *buffer = of_malloc(_s->length + 1, sizeof(of_char32_t)); + of_char32_t *buffer = of_alloc(_s->length + 1, sizeof(of_char32_t)); size_t i = 0, j = 0; while (i < _s->cStringLength) { of_char32_t c; ssize_t cLen;