GNU bug report logs - #44850
27.1; Emacs crash in font handling with font-backend ns

Previous Next

Package: emacs;

Reported by: Pieter van Oostrum <pieter <at> vanoostrum.org>

Date: Tue, 24 Nov 2020 18:11:02 UTC

Severity: normal

Found in versions 27.1, 28.0.50

Full log


View this message in rfc822 format

From: Mattias Engdegård <mattiase <at> acm.org>
To: 44850 <at> debbugs.gnu.org
Cc: Lars Ingebrigtsen <larsi <at> gnus.org>, Eli Zaretskii <eliz <at> gnu.org>, pieter-l <at> vanoostrum.org, pieter <at> vanoostrum.org, Alan Third <alan <at> idiocy.org>
Subject: bug#44850: 27.1; Emacs crash in font handling with font-backend ns 
Date: Fri, 27 Nov 2020 18:16:48 +0100
> I'd prefer to lift the restriction introduced by doprnt.c, instead of replacing that character. It isn't clear to me why this restriction is a good idea, and it doesn't seem like lifting the restriction should be hard.

Yes, the restriction is a bit odd but perhaps there was a good reason. For this application, however, we could just switch from esprintf to sprintf in nsterm.m. (The stated reason for using esprintf was in case the string is longer than 2 GiB but I think we would have bigger problems if a frame title ever becomes that long.)

OK for master? (Also fixed the unsightly 'x' while at it)

--- a/src/nsterm.m
+++ b/src/nsterm.m
@@ -7282,7 +7282,7 @@ - (NSSize)windowWillResize: (NSWindow *)sender toSize: (NSSize)frameSize
             old_title = t;
           }
         size_title = xmalloc (strlen (old_title) + 40);
-       esprintf (size_title, "%s  —  (%d x %d)", old_title, cols, rows);
+        sprintf (size_title, "%s  —  (%d × %d)", old_title, cols, rows);
         [window setTitle: [NSString stringWithUTF8String: size_title]];
         [window display];
         xfree (size_title);





This bug report was last modified 4 years and 254 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.