Skip to content
This repository has been archived by the owner on Feb 11, 2021. It is now read-only.

Commit

Permalink
Added a warning comment to SDL_putenv().
Browse files Browse the repository at this point in the history
"Fixes" Bugzilla #779.
  • Loading branch information
icculus committed Dec 15, 2009
1 parent 091165c commit b3e4cd0
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions include/SDL_stdinc.h
Expand Up @@ -267,6 +267,16 @@ char *alloca();
extern DECLSPEC char *SDLCALL SDL_getenv(const char *name);
#endif

/**
* \warning On some platforms, the string you pass to SDL_putenv() becomes
* part of the environment table directly...it will use this specific
* buffer, and not a copy of it! This means you can't free it, and
* other pieces of code may try to write to it. In practice, this
* isn't a big deal, but be aware of the possibility.
* However, due to this issue, you should be prepared to
* pass a (char*), or be willing to cast away the constness of your
* string for this call.
*/
#ifdef HAVE_PUTENV
#define SDL_putenv putenv
#else
Expand Down

0 comments on commit b3e4cd0

Please sign in to comment.