attempt to fix crash from issue #9
authorHarvie <tomas@mudrunka.cz>
Wed, 4 May 2011 11:27:36 +0000 (13:27 +0200)
committerHarvie <tomas@mudrunka.cz>
Wed, 4 May 2011 11:27:36 +0000 (13:27 +0200)
answerscripts.c

index 0162e309d3c3941b443e06605e32eafb9c71ba76..e997d0d6b9316f2542ed182f1d7f07c391eefc99 100755 (executable)
@@ -199,8 +199,10 @@ static PurplePluginInfo info = {
 
 static void init_plugin(PurplePlugin * plugin) {
        //Export static environment variables
-       setenv(ENV_PREFIX "L_AGENT", (char *) purple_core_get_ui(), 1); //ID of IM client used with answerscripts
-       setenv(ENV_PREFIX "L_AGENT_VERSION", (char *) purple_core_get_version(), 1);    //Version of client
+       const char * core_ui = purple_core_get_ui() != 0 ? (const char *) purple_core_get_ui() : "";
+       const char * core_version = purple_core_get_version() != 0 ? (const char *) purple_core_get_version() : "";
+       setenv(ENV_PREFIX "L_AGENT", (char *) core_ui, 1);      //ID of IM client used with answerscripts
+       setenv(ENV_PREFIX "L_AGENT_VERSION", (char *) core_version, 1); //Version of client
 }
 
 PURPLE_INIT_PLUGIN(autoanswer, init_plugin, info)
This page took 0.099531 seconds and 4 git commands to generate.