]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
snprintf needs a format string too, and write has the warn_unused_result attribute...
authorStefan Knoblich <stkn@freeswitch.org>
Tue, 21 Apr 2009 00:44:33 +0000 (00:44 +0000)
committerStefan Knoblich <stkn@freeswitch.org>
Tue, 21 Apr 2009 00:44:33 +0000 (00:44 +0000)
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@13090 d0543943-73ff-0310-b7d9-9358b9ac24b2

src/mod/event_handlers/mod_erlang_event/ei_helpers.c

index 60a063fe430c26ca80b28ca033ad50d1e28a52f9..c08a54dbabf3e0046504f35bb2f389bc17c68959 100644 (file)
@@ -58,7 +58,7 @@ void ei_link(listener_t *listener, erlang_pid *from, erlang_pid *to) {
        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 @@ void ei_link(listener_t *listener, erlang_pid *from, erlang_pid *to) {
        /* 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 @@ int ei_spawn(struct ei_cnode_s *ec, int sockfd, erlang_ref *ref, char *module, c
 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++;