From 7bbfd00344c67ed5c8644ab23641e1df92e2e2a3 Mon Sep 17 00:00:00 2001 From: Tusharsb Date: Wed, 2 Dec 2015 14:53:52 +0530 Subject: [PATCH] Making bot.c compatible to C++ By this small type casting change, I am able to compile bot.c with both ``gcc`` as well as with ``g++`` I am now able to use bot.c in my c++ programs --- examples/bot.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/bot.c b/examples/bot.c index 80a93f3..26d512a 100644 --- a/examples/bot.c +++ b/examples/bot.c @@ -84,7 +84,7 @@ int message_handler(xmpp_conn_t * const conn, xmpp_stanza_t * const stanza, void body = xmpp_stanza_new(ctx); xmpp_stanza_set_name(body, "body"); - replytext = malloc(strlen(" to you too!") + strlen(intext) + 1); + replytext = (char *) malloc(strlen(" to you too!") + strlen(intext) + 1); strcpy(replytext, intext); strcat(replytext, " to you too!"); xmpp_free(ctx, intext);