From: Harvie Date: Wed, 4 May 2011 11:27:36 +0000 (+0200) Subject: attempt to fix crash from issue #9 X-Git-Url: https://git.harvie.cz/?a=commitdiff_plain;h=61b8b7d94f6e188a074de8d697a08bdf00c140de;p=mirrors%2Flibpurple-core-answerscripts.git attempt to fix crash from issue #9 --- diff --git a/answerscripts.c b/answerscripts.c index 0162e30..e997d0d 100755 --- a/answerscripts.c +++ b/answerscripts.c @@ -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)