SDL_ttf: Fixed bug #229 - TTF_FontFaceFamilyName and TTF_FontFaceStyleName should return const char *

From 6326563de82c73ed8103fe3ef1bb49669a7acaa7 Mon Sep 17 00:00:00 2001
From: Sylvain <[EMAIL REDACTED]>
Date: Thu, 23 Jun 2022 09:09:16 +0200
Subject: [PATCH] Fixed bug #229 - TTF_FontFaceFamilyName and
 TTF_FontFaceStyleName should return const char *

---
 SDL_ttf.c | 6 ++++--
 SDL_ttf.h | 8 ++++++--
 2 files changed, 10 insertions(+), 4 deletions(-)

diff --git a/SDL_ttf.c b/SDL_ttf.c
index 650b99b..0cc2be7 100644
--- a/SDL_ttf.c
+++ b/SDL_ttf.c
@@ -3007,12 +3007,14 @@ int TTF_FontFaceIsFixedWidth(const TTF_Font *font)
     return FT_IS_FIXED_WIDTH(font->face);
 }
 
-char* TTF_FontFaceFamilyName(const TTF_Font *font)
+const char *
+TTF_FontFaceFamilyName(const TTF_Font *font)
 {
     return font->face->family_name;
 }
 
-char* TTF_FontFaceStyleName(const TTF_Font *font)
+const char *
+TTF_FontFaceStyleName(const TTF_Font *font)
 {
     return font->face->style_name;
 }
diff --git a/SDL_ttf.h b/SDL_ttf.h
index 9f358d7..1f87279 100644
--- a/SDL_ttf.h
+++ b/SDL_ttf.h
@@ -413,18 +413,22 @@ extern DECLSPEC int SDLCALL TTF_FontFaceIsFixedWidth(const TTF_Font *font);
 /**
  * Get font family name
  *
+ * The returned value shouldn't be modified nor freed.
+ *
  * \param font TTF_Font handle
  * \returns font family name, NULL on error
  */
-extern DECLSPEC char * SDLCALL TTF_FontFaceFamilyName(const TTF_Font *font);
+extern DECLSPEC const char * SDLCALL TTF_FontFaceFamilyName(const TTF_Font *font);
 
 /**
  * Get font style name
  *
+ * The returned value shouldn't be modified nor freed.
+ *
  * \param font TTF_Font handle
  * \returns font style name, NULL on error
  */
-extern DECLSPEC char * SDLCALL TTF_FontFaceStyleName(const TTF_Font *font);
+extern DECLSPEC const char * SDLCALL TTF_FontFaceStyleName(const TTF_Font *font);
 
 /**
  * Check wether a glyph is provided by the font or not