From 93044f7b87430236c1cb661d9e122f9d65cb24d1 Mon Sep 17 00:00:00 2001 From: Alp Aker Date: Fri, 17 Aug 2012 00:12:50 -0400 Subject: [PATCH] * nsfont.m (ns_ascii_average_width): Send initWithFormat selector to an allocated instance of NSString, not to the class itself. --- src/ChangeLog | 5 +++++ src/nsfont.m | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/ChangeLog b/src/ChangeLog index 5e400b20a31..a3ae89b86f2 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2012-08-17 Alp Aker + + * nsfont.m (ns_ascii_average_width): Send initWithFormat selector + to an allocated instance of NSString, not to the class itself. + 2012-08-17 Juanma Barranquero * makefile.w32-in (C_CTYPE_H): New macro. diff --git a/src/nsfont.m b/src/nsfont.m index fdb6e0c33c1..1f8d28cd238 100644 --- a/src/nsfont.m +++ b/src/nsfont.m @@ -275,7 +275,7 @@ ns_ascii_average_width (NSFont *sfont) for (ch = 0; ch < 95; ch++) chars[ch] = ' ' + ch; - ascii_printable = [NSString initWithFormat: @"%s", chars]; + ascii_printable = [[NSString alloc] initWithFormat: @"%s", chars]; } #ifdef NS_IMPL_COCOA -- 2.39.2