From a644b549c57865fe9638b3f2a6fd0c31e8f5a4f6 Mon Sep 17 00:00:00 2001 From: Anthony Minessale Date: Fri, 23 Feb 2007 16:43:07 +0000 Subject: [PATCH] remove redundant strlen git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@4357 d0543943-73ff-0310-b7d9-9358b9ac24b2 --- .../mod_event_socket/mod_event_socket.c | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/src/mod/event_handlers/mod_event_socket/mod_event_socket.c b/src/mod/event_handlers/mod_event_socket/mod_event_socket.c index 628d68f89e..7fb12c079d 100644 --- a/src/mod/event_handlers/mod_event_socket/mod_event_socket.c +++ b/src/mod/event_handlers/mod_event_socket/mod_event_socket.c @@ -554,14 +554,13 @@ static void *SWITCH_THREAD_FUNC api_exec(switch_thread_t *thread, void *obj) switch_event_fire(&event); } } else { - switch_size_t len; - char buf[1024]; - len = strlen(reply); - snprintf(buf, sizeof(buf), "Content-Type: api/response\nContent-Length: %"APR_SSIZE_T_FMT"\n\n", len); - len = strlen(buf); - switch_socket_send(acs->listener->sock, buf, &len); - len = strlen(reply); - switch_socket_send(acs->listener->sock, reply, &len); + switch_size_t rlen, blen; + char buf[1024] = ""; + rlen = strlen(reply); + snprintf(buf, sizeof(buf), "Content-Type: api/response\nContent-Length: %"APR_SSIZE_T_FMT"\n\n", rlen); + blen = strlen(buf); + switch_socket_send(acs->listener->sock, buf, &blen); + switch_socket_send(acs->listener->sock, reply, &rlen); } switch_safe_free(stream.data);