@@ -35,11 +35,11 @@ #import "OFFile.h" #import "OFAutoreleasePool.h" #import "OFExceptions.h" #import "macros.h" -#import "asprintf.h" +#import "of_asprintf.h" #import "unicode.h" extern const uint16_t of_iso_8859_15[256]; extern const uint16_t of_windows_1252[256]; @@ -464,26 +464,22 @@ arguments: (va_list)args { self = [super init]; @try { - int t; + int len; if (fmt == nil) @throw [OFInvalidArgumentException newWithClass: isa selector: _cmd]; - if ((t = vasprintf(&string, [fmt cString], args)) == -1) - /* - * This is only the most likely error to happen. - * Unfortunately, there is no good way to check what - * really happened. - */ - @throw [OFOutOfMemoryException newWithClass: isa]; + if ((len = of_vasprintf(&string, [fmt cString], args)) == -1) + @throw [OFInvalidArgumentException newWithClass: isa + selector: _cmd]; @try { - length = t; + length = len; switch (of_string_check_utf8(string, length)) { case 1: isUTF8 = YES; break;