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
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
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
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
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
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
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
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
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
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
The old code was reusing the 'window' variable, which means that it
could pick up the STATUS_NOTIFY format from the wrong window. You
would only have noticed this if you have windows with different settings
for STATUS_NOTIFY.
git-svn-id: svn://svn.code.sf.net/p/bitchx/code/trunk@425 13b04d17-f746-0410-82c6-800466cd88b0
Status formats support a %<PAD>c syntax for specifying padding. This change
ensures that we only use padding consisting of the characters "0123456789.",
which ensures it won't confuse sprintf.
git-svn-id: svn://svn.code.sf.net/p/bitchx/code/trunk@424 13b04d17-f746-0410-82c6-800466cd88b0
We can also rearrange things to remove the need for the add_ext variable,
hopefully also making the logic a bit more clear.
git-svn-id: svn://svn.code.sf.net/p/bitchx/code/trunk@423 13b04d17-f746-0410-82c6-800466cd88b0