diff options
author | Walter Doekes <walter+asterisk@wjd.nu> | 2012-04-17 18:57:40 +0000 |
---|---|---|
committer | Walter Doekes <walter+asterisk@wjd.nu> | 2012-04-17 18:57:40 +0000 |
commit | fc63e07135d645af0df8d393aa84c0ae3b7e1924 (patch) | |
tree | f40524fe8e0facf5542c6b02041bc1fc63eae66e /channels/chan_unistim.c | |
parent | 70c5ac6635062efe03b51fb6c7afd30c22028be9 (diff) |
Avoid cppcheck warnings; removing unused vars and a bit of cleanup.
Patch by: junky
Review: https://reviewboard.asterisk.org/r/1743/
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@362307 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'channels/chan_unistim.c')
-rw-r--r-- | channels/chan_unistim.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/channels/chan_unistim.c b/channels/chan_unistim.c index 723500e45..411d8f4e7 100644 --- a/channels/chan_unistim.c +++ b/channels/chan_unistim.c @@ -891,8 +891,6 @@ static void send_raw_client(int size, const unsigned char *data, struct sockaddr #ifdef DUMP_PACKET if (unistimdebug) { int tmp; - char iabuf[INET_ADDRSTRLEN]; - char iabuf2[INET_ADDRSTRLEN]; ast_verb(0, "\n**> From %s sending %d bytes to %s ***\n", ast_inet_ntoa(addr_ourip->sin_addr), (int) size, ast_inet_ntoa(addr_to->sin_addr)); @@ -3952,12 +3950,14 @@ static char open_history(struct unistimsession *pte, char way, FILE ** f) if (fread(&count, 1, 1, *f) != 1) { display_last_error("Unable to read history header - display."); fclose(*f); + *f = NULL; return 0; } if (count > MAX_ENTRY_LOG) { ast_log(LOG_WARNING, "Invalid count in history header of %s (%d max %d)\n", tmp, count, MAX_ENTRY_LOG); fclose(*f); + *f = NULL; return 0; } return count; @@ -4922,7 +4922,6 @@ static int unistimsock_read(int *id, int fd, short events, void *ignore) unsigned int size_addr_from; #ifdef DUMP_PACKET int dw_num_bytes_rcvdd; - char iabuf[INET_ADDRSTRLEN]; #endif size_addr_from = sizeof(addr_from); @@ -5369,7 +5368,11 @@ static int unistim_sendtext(struct ast_channel *ast, const char *text) } if (!text) { ast_log(LOG_WARNING, "unistim_sendtext called with a null text\n"); - return 1; + return -1; + } + + if (!pte) { + return -1; } size = strlen(text); |