Commit Graph

454 Commits

Author SHA1 Message Date
Kevin Easton
de3d310678 Change RETURN_STR() macro to silence 'always evaluates to true' warnings.
git-svn-id: svn://svn.code.sf.net/p/bitchx/code/trunk@475 13b04d17-f746-0410-82c6-800466cd88b0
2013-11-16 11:35:41 +00:00
Kevin Easton
324cdd4c85 Update plugins to cast time_t to long when formatting with %ld.
Fixes platforms where time_t and long are different sizes.


git-svn-id: svn://svn.code.sf.net/p/bitchx/code/trunk@474 13b04d17-f746-0410-82c6-800466cd88b0
2013-11-16 10:59:34 +00:00
Kevin Easton
87de292f53 cdcc.c: Cast time_t to long before formatting with %ld.
Fixes platforms where time_t and long are not the same size, like netbsd i386.


git-svn-id: svn://svn.code.sf.net/p/bitchx/code/trunk@473 13b04d17-f746-0410-82c6-800466cd88b0
2013-11-16 03:18:39 +00:00
Kevin Easton
d03781f45b Fix the $timer() scripting function.
This function never worked - function_timer() was creating a string but then
never throwing it away and returning a part of the argument instead, which
then caused a crash because it couldn't be freed later in the expression
parsing.


git-svn-id: svn://svn.code.sf.net/p/bitchx/code/trunk@472 13b04d17-f746-0410-82c6-800466cd88b0
2013-11-16 03:17:13 +00:00
Kevin Easton
ffea653764 Fix the /TKB (timed kickban) command.
An incorrect pointer was being passed to malloc_sprintf(), causing a
crash.  Use m_sprintf() instead.


git-svn-id: svn://svn.code.sf.net/p/bitchx/code/trunk@471 13b04d17-f746-0410-82c6-800466cd88b0
2013-11-16 03:13:26 +00:00
Kevin Easton
5a3a74d38a functions.c: Fix mismatched format strings in several aliases and functions.
Affected functions are alias_idle(), alias_serverlag(), alias_awaytime(),
function_serverpass(), function_checkuser() and function_isuser().

This fixes $serverpass(), which seems to have never worked right.


git-svn-id: svn://svn.code.sf.net/p/bitchx/code/trunk@470 13b04d17-f746-0410-82c6-800466cd88b0
2013-11-16 01:33:53 +00:00
Kevin Easton
55d3b28060 dcc.c: Fix mismatching format strings in get_dcc_info() and dcc_ftpcommand().
Cast time_t value to long and use %ld to print.


git-svn-id: svn://svn.code.sf.net/p/bitchx/code/trunk@469 13b04d17-f746-0410-82c6-800466cd88b0
2013-11-16 00:18:39 +00:00
Kevin Easton
021812f6ae Respin configure and defs.h.in for configure.in r467.
git-svn-id: svn://svn.code.sf.net/p/bitchx/code/trunk@468 13b04d17-f746-0410-82c6-800466cd88b0
2013-11-16 00:09:33 +00:00
Kevin Easton
f178d6e024 Fix int/long typo.
git-svn-id: svn://svn.code.sf.net/p/bitchx/code/trunk@467 13b04d17-f746-0410-82c6-800466cd88b0
2013-11-16 00:08:31 +00:00
Kevin Easton
e7c8240622 Use long instead of time_t in send_kline(), and cast time_t values to long in sping() when using %ld format.
This fixes bugs on netbsd i386, where time_t is longer than long.


git-svn-id: svn://svn.code.sf.net/p/bitchx/code/trunk@466 13b04d17-f746-0410-82c6-800466cd88b0
2013-11-15 13:57:46 +00:00
Kevin Easton
77ee55f33f Simplify function_uptime() and change it to use long instead of time_t.
This fixes a series of compiler warnings on netbsd i386.


git-svn-id: svn://svn.code.sf.net/p/bitchx/code/trunk@465 13b04d17-f746-0410-82c6-800466cd88b0
2013-11-15 12:55:44 +00:00
Kevin Easton
70b1c060f3 Change function_tdiff2() to use long instead of time_t, which fixes warnings on netbsd i386.
Also rework function to use snprintf() instead of sprintf().


git-svn-id: svn://svn.code.sf.net/p/bitchx/code/trunk@464 13b04d17-f746-0410-82c6-800466cd88b0
2013-11-15 12:11:19 +00:00
Kevin Easton
b2ae3c888f Cleanup get_term_capability(), silences some warnings.
git-svn-id: svn://svn.code.sf.net/p/bitchx/code/trunk@463 13b04d17-f746-0410-82c6-800466cd88b0
2013-11-13 13:35:10 +00:00
Kevin Easton
58b5d39fea Remove unnecessary variable proctitlestr.
git-svn-id: svn://svn.code.sf.net/p/bitchx/code/trunk@462 13b04d17-f746-0410-82c6-800466cd88b0
2013-11-13 11:43:57 +00:00
Kevin Easton
3b99834e00 Partially revert r456.
An snprintf() call that creates IRC protocol messages must use 
(MAX_PROTOCOL_SIZE + 1) as 'n' rather than the buffer size.


git-svn-id: svn://svn.code.sf.net/p/bitchx/code/trunk@461 13b04d17-f746-0410-82c6-800466cd88b0
2013-11-13 09:57:15 +00:00
Tim Cava
582d720ea4 Convert sprintf calls to snprintf. From pvaldes.
git-svn-id: svn://svn.code.sf.net/p/bitchx/code/trunk@460 13b04d17-f746-0410-82c6-800466cd88b0
2013-11-11 21:29:21 +00:00
Tim Cava
496d3dc8ff Convert sprintf calls to snprintf. From pvaldes.
git-svn-id: svn://svn.code.sf.net/p/bitchx/code/trunk@459 13b04d17-f746-0410-82c6-800466cd88b0
2013-11-11 21:29:16 +00:00
Tim Cava
f69404b0f9 Convert sprintf calls to snprintf. From pvaldes.
git-svn-id: svn://svn.code.sf.net/p/bitchx/code/trunk@458 13b04d17-f746-0410-82c6-800466cd88b0
2013-11-11 21:29:11 +00:00
Tim Cava
4f5aab355b Convert sprintf calls to snprintf. From pvaldes.
git-svn-id: svn://svn.code.sf.net/p/bitchx/code/trunk@457 13b04d17-f746-0410-82c6-800466cd88b0
2013-11-11 21:29:05 +00:00
Tim Cava
317b84ee9d Convert sprintf calls to snprintf. From pvaldes.
git-svn-id: svn://svn.code.sf.net/p/bitchx/code/trunk@456 13b04d17-f746-0410-82c6-800466cd88b0
2013-11-11 21:29:00 +00:00
Tim Cava
c9d059cee6 Convert sprintf calls to snprintf. From pvaldes.
git-svn-id: svn://svn.code.sf.net/p/bitchx/code/trunk@455 13b04d17-f746-0410-82c6-800466cd88b0
2013-11-11 21:28:55 +00:00
Tim Cava
1bafc85e23 Convert sprintf calls to snprintf. From pvaldes.
git-svn-id: svn://svn.code.sf.net/p/bitchx/code/trunk@454 13b04d17-f746-0410-82c6-800466cd88b0
2013-11-11 21:28:48 +00:00
Tim Cava
dd88392b15 Convert sprintf calls to snprintf. From pvaldes.
git-svn-id: svn://svn.code.sf.net/p/bitchx/code/trunk@453 13b04d17-f746-0410-82c6-800466cd88b0
2013-11-11 21:28:38 +00:00
Tim Cava
3287f7775b Convert sprintf calls to snprintf. From pvaldes.
git-svn-id: svn://svn.code.sf.net/p/bitchx/code/trunk@452 13b04d17-f746-0410-82c6-800466cd88b0
2013-11-11 21:28:31 +00:00
Tim Cava
2677dc4c60 Convert sprintf calls to snprintf. From pvaldes.
git-svn-id: svn://svn.code.sf.net/p/bitchx/code/trunk@451 13b04d17-f746-0410-82c6-800466cd88b0
2013-11-11 21:28:26 +00:00
Tim Cava
bfc147418a Convert sprintf calls to snprintf. From pvaldes.
git-svn-id: svn://svn.code.sf.net/p/bitchx/code/trunk@450 13b04d17-f746-0410-82c6-800466cd88b0
2013-11-11 21:28:19 +00:00
Tim Cava
9d7c4f93d0 Convert sprintf calls to snprintf. From pvaldes.
git-svn-id: svn://svn.code.sf.net/p/bitchx/code/trunk@449 13b04d17-f746-0410-82c6-800466cd88b0
2013-11-11 21:28:10 +00:00
Tim Cava
c7e6e5ea08 Convert sprintf calls to snprintf. From pvaldes.
git-svn-id: svn://svn.code.sf.net/p/bitchx/code/trunk@448 13b04d17-f746-0410-82c6-800466cd88b0
2013-11-11 21:28:03 +00:00
Tim Cava
c1530e9406 Convert sprintf calls to snprintf. From pvaldes.
git-svn-id: svn://svn.code.sf.net/p/bitchx/code/trunk@447 13b04d17-f746-0410-82c6-800466cd88b0
2013-11-11 21:24:14 +00:00
Tim Cava
78265498b1 Convert sprintf calls to snprintf. From pvaldes.
git-svn-id: svn://svn.code.sf.net/p/bitchx/code/trunk@446 13b04d17-f746-0410-82c6-800466cd88b0
2013-11-11 21:23:51 +00:00
Tim Cava
224143f653 Convert sprintf calls to snprintf. From pvaldes.
git-svn-id: svn://svn.code.sf.net/p/bitchx/code/trunk@445 13b04d17-f746-0410-82c6-800466cd88b0
2013-11-11 21:23:25 +00:00
Tim Cava
db8c5cdc4f Convert sprintf calls to snprintf. From pvaldes.
git-svn-id: svn://svn.code.sf.net/p/bitchx/code/trunk@444 13b04d17-f746-0410-82c6-800466cd88b0
2013-11-11 21:22:00 +00:00
Tim Cava
6fed90327c Convert sprintf calls to snprintf. From pvaldes.
git-svn-id: svn://svn.code.sf.net/p/bitchx/code/trunk@443 13b04d17-f746-0410-82c6-800466cd88b0
2013-11-11 21:20:39 +00:00
Kevin Easton
d9a81a2841 who.c: Apply patch from tau replacing sprintf() with snprintf().
Also some minor associated cleanups from me.


git-svn-id: svn://svn.code.sf.net/p/bitchx/code/trunk@442 13b04d17-f746-0410-82c6-800466cd88b0
2013-11-11 13:48:32 +00:00
Kevin Easton
220225f4ff whowas.c: Apply patch from tau replacing sprintf() with snprintf().
git-svn-id: svn://svn.code.sf.net/p/bitchx/code/trunk@441 13b04d17-f746-0410-82c6-800466cd88b0
2013-11-11 13:37:14 +00:00
Kevin Easton
f222b94d13 window.c: Apply patch from tau replacing sprintf() with snprintf().
git-svn-id: svn://svn.code.sf.net/p/bitchx/code/trunk@440 13b04d17-f746-0410-82c6-800466cd88b0
2013-11-11 13:24:38 +00:00
Kevin Easton
f086f264bb wserv.c: Apply patch from tau converting sprintf() to snprintf().
git-svn-id: svn://svn.code.sf.net/p/bitchx/code/trunk@439 13b04d17-f746-0410-82c6-800466cd88b0
2013-11-11 13:23:11 +00:00
Kevin Easton
03761ec715 Respin configure and defs.h.in for new configure.in, and update ircterm.h to match.
ircterm.h now includes ncurses/ncurses.h if present, which is necessary for Cygwin.


git-svn-id: svn://svn.code.sf.net/p/bitchx/code/trunk@438 13b04d17-f746-0410-82c6-800466cd88b0
2013-11-10 12:00:08 +00:00
Kevin Easton
f2aa46e252 Add check for ncurses/ncurses.h to configure. This is where Cygwin installs ncurses.
git-svn-id: svn://svn.code.sf.net/p/bitchx/code/trunk@437 13b04d17-f746-0410-82c6-800466cd88b0
2013-11-10 11:57:45 +00:00
Kevin Easton
ecabc12b3d Add helper macros to always call tparm() with 10 arguments.
This ensures portability to systems with a fixed-argument list declaration
of tparm(), like NetBSD curses.


git-svn-id: svn://svn.code.sf.net/p/bitchx/code/trunk@436 13b04d17-f746-0410-82c6-800466cd88b0
2013-11-10 06:27:03 +00:00
Kevin Easton
0fe37326a3 Rebuild configure and defs.h.in from new configure.in, and update code to match.
This simplifies the inclusion logic in ircterm.h, and updates term.c to include
term.h if available.  This removes the declarations for setupterm(), tigetstr(),
tigetnum(), tigetflag(), tgetent(), tgetstr(), tgetnum() and tgetflag() from
term.c as those should be defined in term.h or termcap.h.

This should make the system declaration of tparm() available to term.c, which
will fix a crash on NetBSD x86-64 caused by the implicit declaration of tparm()
having a return type of 'int' while the real function has a return type of
'char *'.

We have to include term.h in term.c, not in ircterm.h because term.h defines
a large number of macros, at least two of which ('lines' and 'goto_window')
conflict with names in use in the rest of the codebase.


git-svn-id: svn://svn.code.sf.net/p/bitchx/code/trunk@435 13b04d17-f746-0410-82c6-800466cd88b0
2013-11-10 05:38:06 +00:00
Kevin Easton
73c9947324 Rewrite the termcap/terminfo detection logic in configure.
The new logic is considerably shorter and simpler, and should mean that
terminfo is properly used in preference to termcap on NetBSD.  This also
allows us to include term.h in term.c, where the system definition of
tparm() lives on some systems (NetBSD is one such).

The new logic also means we link against libtinfo in preference to
libncurses, which should mean a little less memory used at runtime and a
fraction faster startup time.


git-svn-id: svn://svn.code.sf.net/p/bitchx/code/trunk@434 13b04d17-f746-0410-82c6-800466cd88b0
2013-11-10 04:50:52 +00:00
Kevin Easton
96f1d64aa0 Change ircterm.h header include guard so that it doesn't clash with
the system term.h.


git-svn-id: svn://svn.code.sf.net/p/bitchx/code/trunk@433 13b04d17-f746-0410-82c6-800466cd88b0
2013-11-09 11:04:30 +00:00
Tim Cava
112b38ac7a Revert the last commit. It accidentally had autogenerated files in it.
git-svn-id: svn://svn.code.sf.net/p/bitchx/code/trunk@432 13b04d17-f746-0410-82c6-800466cd88b0
2013-11-07 03:00:24 +00:00
Tim Cava
276fd24258 Use snprintf rather than sprintf. From pvaldes.
git-svn-id: svn://svn.code.sf.net/p/bitchx/code/trunk@431 13b04d17-f746-0410-82c6-800466cd88b0
2013-11-07 02:41:16 +00:00
Kevin Easton
590ae4c685 Further cleanups in dcc.c, removing unused variables and reworking dcc_exempt_save().
git-svn-id: svn://svn.code.sf.net/p/bitchx/code/trunk@430 13b04d17-f746-0410-82c6-800466cd88b0
2013-11-06 10:35:16 +00:00
Kevin Easton
15894eb006 Some simplification / cleanup in dcc_glist().
git-svn-id: svn://svn.code.sf.net/p/bitchx/code/trunk@429 13b04d17-f746-0410-82c6-800466cd88b0
2013-11-05 13:07:06 +00:00
Kevin Easton
456a0061f0 Fix output when client is built against termcap.
The pointer passed to tgetstr() must not be reset each time around the loop.
Also some other minor cleanups in term_init().


git-svn-id: svn://svn.code.sf.net/p/bitchx/code/trunk@428 13b04d17-f746-0410-82c6-800466cd88b0
2013-11-01 13:06:02 +00:00
Tim Cava
8e8a4022f9 Cleanup check_serverlag(), with suggestions from caf.
git-svn-id: svn://svn.code.sf.net/p/bitchx/code/trunk@427 13b04d17-f746-0410-82c6-800466cd88b0
2013-11-01 11:32:57 +00:00
Kevin Easton
25dcf0709b Don't crash if the user gives a bogus status format with too many elements.
Replace unused .format_var member of status_expandos list with .args. For
expandos which have a subformat, this stores how many arguments are passed to
sprintf() when the subformat is expanded in the callback function.  The
convert_sub_format() function then uses this to limit the number of %s
conversion specifiers it creates in the converted subformat.


git-svn-id: svn://svn.code.sf.net/p/bitchx/code/trunk@426 13b04d17-f746-0410-82c6-800466cd88b0
2013-10-30 13:09:03 +00:00