[Freeswitch-svn] [commit] r13090 - freeswitch/trunk/src/mod/event_handlers/mod_erlang_event
FreeSWITCH SVN
stkn at freeswitch.org
Mon Apr 20 17:44:33 PDT 2009
Author: stkn
Date: Mon Apr 20 19:44:33 2009
New Revision: 13090
Log:
snprintf needs a format string too, and write has the warn_unused_result attribute set, so store the return value somewhere
Modified:
freeswitch/trunk/src/mod/event_handlers/mod_erlang_event/ei_helpers.c
Modified: freeswitch/trunk/src/mod/event_handlers/mod_erlang_event/ei_helpers.c
==============================================================================
--- freeswitch/trunk/src/mod/event_handlers/mod_erlang_event/ei_helpers.c (original)
+++ freeswitch/trunk/src/mod/event_handlers/mod_erlang_event/ei_helpers.c Mon Apr 20 19:44:33 2009
@@ -58,7 +58,7 @@
char msgbuf[2048];
char *s;
int index = 0;
- /*int n;*/
+ int ret;
index = 5; /* max sizes: */
ei_encode_version(msgbuf,&index); /* 1 */
@@ -74,7 +74,7 @@
/* sum: 542 */
switch_mutex_lock(listener->sock_mutex);
- write(listener->sockfd, msgbuf, index);
+ ret = write(listener->sockfd, msgbuf, index);
switch_mutex_unlock(listener->sock_mutex);
}
@@ -190,7 +190,7 @@
void ei_init_ref(ei_cnode *ec, erlang_ref *ref)
{
memset(ref, 0, sizeof(*ref)); /* zero out the struct */
- snprintf(ref->node, MAXATOMLEN, ec->thisnodename);
+ snprintf(ref->node, MAXATOMLEN, "%s", ec->thisnodename);
switch_mutex_lock(globals.ref_mutex);
globals.reference0++;
More information about the Freeswitch-svn
mailing list