From adc9598f1aecbdd8f43f62af7343b5760bfeb506 Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Sun, 29 Aug 2010 12:00:09 -0700 Subject: [PATCH] While you can actually write to the error buffer, conceptually it's read-only. --- include/SDL_error.h | 2 +- src/SDL_error.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/include/SDL_error.h b/include/SDL_error.h index a4a90d0e4..5aa5c9162 100644 --- a/include/SDL_error.h +++ b/include/SDL_error.h @@ -41,7 +41,7 @@ extern "C" { /* Public functions */ extern DECLSPEC void SDLCALL SDL_SetError(const char *fmt, ...); -extern DECLSPEC char *SDLCALL SDL_GetError(void); +extern DECLSPEC const char *SDLCALL SDL_GetError(void); extern DECLSPEC void SDLCALL SDL_ClearError(void); /** diff --git a/src/SDL_error.c b/src/SDL_error.c index 99ac09cdc..1f6c8a903 100644 --- a/src/SDL_error.c +++ b/src/SDL_error.c @@ -198,12 +198,12 @@ SDL_GetErrorMsg(char *errstr, unsigned int maxlen) } /* Available for backwards compatibility */ -char * +const char * SDL_GetError(void) { static char errmsg[SDL_ERRBUFIZE]; - return ((char *) SDL_GetErrorMsg(errmsg, SDL_ERRBUFIZE)); + return SDL_GetErrorMsg(errmsg, SDL_ERRBUFIZE); } void