From 62af550c0b520e7107e52aa97e72834233edfb15 Mon Sep 17 00:00:00 2001 From: whitequark Date: Wed, 25 Mar 2015 01:48:17 +0300 Subject: [PATCH] Fix try..catch clauses dealing with C strings. On *nix, a thrown string literal cannot be caught using catch(char*), resulting in crashes. --- src/ttf.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/ttf.cpp b/src/ttf.cpp index b0a673f..efdc5a4 100644 --- a/src/ttf.cpp +++ b/src/ttf.cpp @@ -579,8 +579,8 @@ bool TtfFont::LoadFontFromFile(bool nameOnly) { fseek(fh, glyfAddr + glyphOffsets[i], SEEK_SET); LoadGlyph(i); } - } catch (char *s) { - dbp("failed: '%s'", s); + } catch (const char *s) { + dbp("ttf: file %s failed: '%s'", fontFile, s); fclose(fh); return false; }