changeset 3567:fb9ea4b549c3

Added a warning comment to SDL_putenv(). "Fixes" Bugzilla #779.
author Ryan C. Gordon <icculus@icculus.org>
date Tue, 15 Dec 2009 18:00:16 +0000
parents 07c8339c95c6
children 8c72321542f6
files include/SDL_stdinc.h
diffstat 1 files changed, 10 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/include/SDL_stdinc.h	Tue Dec 15 09:20:10 2009 +0000
+++ b/include/SDL_stdinc.h	Tue Dec 15 18:00:16 2009 +0000
@@ -267,6 +267,16 @@
 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