Fix a couple of compiler warnings in irc.c - two places where the address

of an array was tested (always not-NULL) and one unused variable (first_time
in io()).

The user-visible change here is that the emergency exit QUIT messages 
(eg "User abort with 5 Ctrl-C's") will be correctly relayed to the local 
terminal now.


git-svn-id: svn://svn.code.sf.net/p/bitchx/code/trunk@321 13b04d17-f746-0410-82c6-800466cd88b0
This commit is contained in:
Kevin Easton
2013-08-14 14:39:24 +00:00
parent 1cfaf1349c
commit a6f8021cd9
2 changed files with 17 additions and 21 deletions

View File

@@ -1,5 +1,7 @@
[Changes 1.2c01]
* Show same message on local terminal as used in emergency exit QUIT. (caf)
* Remove unused XLINK CTCP reply handler. (caf)
* Ensure add_socketread() doesn't leak file descriptors. (caf)

View File

@@ -437,8 +437,7 @@ void BX_irc_exit (int really_quit, char *reason, char *format, ...)
close_all_servers(reason ? reason : buffer);
put_it("%s", buffer ? buffer : reason ? reason : empty_string);
put_it("%s", !format && reason ? reason : buffer);
clean_up_processes();
if (!dumb_mode && term_initialized)
@@ -1138,7 +1137,7 @@ static char *parse_args (char *argv[], int argc, char **envp)
#endif
}
if (!nickname || !*nickname)
if (!*nickname)
strlcpy(nickname, username, sizeof nickname);
if (!check_nickname(nickname))
@@ -1201,23 +1200,19 @@ extern void set_screens (fd_set *, fd_set *);
void BX_io (const char *what)
{
static int first_time = 1,
level = 0;
long clock_timeout = 0,
timer_timeout = 0,
server_timeout = 0,
real_timeout = 0;
static struct timeval my_now,
my_timer,
*time_ptr = &my_timer;
int hold_over,
rc;
fd_set rd,
wd;
static int old_level = 0;
static const char *caller[51] = { NULL }; /* XXXX */
static int last_warn = 0;
static int level = 0;
long clock_timeout = 0,
timer_timeout = 0,
server_timeout = 0,
real_timeout = 0;
static struct timeval my_now,
my_timer,
*time_ptr = &my_timer;
int hold_over, rc;
fd_set rd, wd;
static int old_level = 0;
static const char *caller[51] = { NULL }; /* XXXX */
static int last_warn = 0;
level++;
@@ -1304,7 +1299,6 @@ static const char *caller[51] = { NULL }; /* XXXX */
case -1:
{
/* if we just got a sigint */
first_time = 0;
if (cntl_c_hit)
{
edit_char('\003');