/* set the DISPLAY environment variable for any lauched children, to the
display we're using, so they open in the right place. */
- putenv(g_strdup_printf("DISPLAY=%s", DisplayString(ob_display)));
+ setenv("DISPLAY", DisplayString(ob_display), TRUE);
/* create available cursors */
cursors[OB_CURSOR_NONE] = None;
static void parse_env()
{
/* unset this so we don't pass it on unknowingly */
- putenv(g_strdup("DESKTOP_STARTUP_ID"));
+ unsetenv("DESKTOP_STARTUP_ID");
}
static void parse_args(gint *argc, gchar **argv)
#include "gettext.h"
#include "event.h"
-#include <stdlib.h>
+#ifdef HAVE_STDLIB_H
+# include <stdlib.h>
+#endif
#ifndef USE_LIBSN
g_direct_equal,
(GDestroyNotify)sn_launcher_context_unref);
- putenv(g_strdup_printf("DESKTOP_STARTUP_ID=%s", id));
+ setenv("DESKTOP_STARTUP_ID", id, TRUE);
g_free(desc);
}