Commit Graph

29 Commits

Author SHA1 Message Date
gdinit
bac141898b Correct spelling of some client messages, comments and function names 2017-10-20 14:57:17 +11:00
Kevin Easton
4a3cff53f4 Simplify and improve justification step of status formatting, and use the same code for $statsparse()
Separate out the justification step of make_status() into a new function, so it can be wired in to
stat_convert_format() as well.  This makes $statsparse() work correctly with right-justified status
formats.

Minimise the amount of copying around that is done during the justification - instead, we can just
remember pointers into the buffer returned by strip_ansi() for the left-hand-side, right-hand-side and
padding character.

Don't keep concatenating onto the same buffer with strlcat() when generating the padding - that gives
n^2 behaviour.  Instead keep a pointer to the current end and concatenate there.

Ensure buffer is null-terminated before calling strlcat() on it, in stat_convert_format().
2017-08-23 02:21:42 +10:00
Kevin Easton
74ee653d24 Remove unnecessary extern declaration of ov_server()
It is declared in output.h, which is already included by status.c.
2016-04-06 21:33:06 +10:00
Kevin Easton
d0b0a95330 Convert skip_ctl_c_seq() and its callers (except strip_ansi()) from unsigned char to char
This should make no functional difference, and cuts out a large number of
unsigned char * / char * mismatch warnings.
2015-06-17 22:50:49 +10:00
Kevin Easton
563493dd6a Add COLOR_CHAR and BELL_CHAR defines to replace open-coded values 2015-06-16 19:06:30 +10:00
Kevin Easton
c41048b896 Increase size of buffer to handle maximum-length topics in status_topic().
This affects the maximum length of the topic that can be displayed by the %-
status format.  No topic can be longer than IRCD_BUFFER_SIZE, so use that.

Reported by oxy.


git-svn-id: svn://svn.code.sf.net/p/bitchx/code/trunk@508 13b04d17-f746-0410-82c6-800466cd88b0
2014-10-14 12:57:01 +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
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
Kevin Easton
02327eebae Fix STATUS_NOTIFY so that it appears in the right window.
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
2013-10-29 13:25:10 +00:00
Kevin Easton
e9d180f526 Improve handling of padding in status formats.
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
2013-10-29 13:14:19 +00:00
Tim Cava
1d1cd09ee3 Cleanup status_notify_windows() a little bit. Use strlcat rather than strmcat.
git-svn-id: svn://svn.code.sf.net/p/bitchx/code/trunk@415 13b04d17-f746-0410-82c6-800466cd88b0
2013-10-26 02:43:57 +00:00
Tim Cava
e9ef2d4e55 Use strlcat, rather than strmcat, in make_status(). Remove a block of unused
ifdefed out code.


git-svn-id: svn://svn.code.sf.net/p/bitchx/code/trunk@414 13b04d17-f746-0410-82c6-800466cd88b0
2013-10-26 02:34:25 +00:00
Tim Cava
fdb83238de Cleanup stat_convert_format() a little bit. Use strlcat rather than strmcat.
git-svn-id: svn://svn.code.sf.net/p/bitchx/code/trunk@413 13b04d17-f746-0410-82c6-800466cd88b0
2013-10-26 02:28:13 +00:00
Tim Cava
26e070565e Use strlcat, rather than strmcat, in fix_status_buffer(). Remove unused
blocks of ifdeffed out code.


git-svn-id: svn://svn.code.sf.net/p/bitchx/code/trunk@412 13b04d17-f746-0410-82c6-800466cd88b0
2013-10-26 02:20:19 +00:00
Tim Cava
95235006ab Cleanup convert_sub_format() a little bit. Use strlcat rather than strmcat.
Remove a variable that had no affect.


git-svn-id: svn://svn.code.sf.net/p/bitchx/code/trunk@411 13b04d17-f746-0410-82c6-800466cd88b0
2013-10-26 02:12:42 +00:00
Tim Cava
8a0d84b3ab Use strlcpy, rather than strmcpy, in status_windowspec().
git-svn-id: svn://svn.code.sf.net/p/bitchx/code/trunk@338 13b04d17-f746-0410-82c6-800466cd88b0
2013-08-17 05:06:38 +00:00
Tim Cava
bcdf91f415 Use strlcpy, rather than strmcpy, in status_refnum().
git-svn-id: svn://svn.code.sf.net/p/bitchx/code/trunk@337 13b04d17-f746-0410-82c6-800466cd88b0
2013-08-17 05:04:20 +00:00
Tim Cava
e8bca384b9 Use strlcpy, rather than strmcpy, in status_topic().
git-svn-id: svn://svn.code.sf.net/p/bitchx/code/trunk@336 13b04d17-f746-0410-82c6-800466cd88b0
2013-08-17 05:01:46 +00:00
Tim Cava
adf7bc4b68 Use strlcpy, rather than strmcpy, in status_channel().
git-svn-id: svn://svn.code.sf.net/p/bitchx/code/trunk@335 13b04d17-f746-0410-82c6-800466cd88b0
2013-08-17 04:59:44 +00:00
Tim Cava
d56010df9b Use strlcpy, rather than strmcpy, in status_umode().
git-svn-id: svn://svn.code.sf.net/p/bitchx/code/trunk@334 13b04d17-f746-0410-82c6-800466cd88b0
2013-08-17 04:54:42 +00:00
Tim Cava
fdddcf99bf Use strlcpy, rather than strmcpy, in make_status().
git-svn-id: svn://svn.code.sf.net/p/bitchx/code/trunk@333 13b04d17-f746-0410-82c6-800466cd88b0
2013-08-17 04:47:19 +00:00
Tim Cava
89d82d7ae0 Use strlcpy, rather than strmcpy, in fix_status_buffer().
git-svn-id: svn://svn.code.sf.net/p/bitchx/code/trunk@332 13b04d17-f746-0410-82c6-800466cd88b0
2013-08-17 04:39:08 +00:00
Kevin Easton
cc0a27d7fe Rework stripansicodes() to take a const char * argument rather than const unsigned char *,
fixing a large number of warnings. 


git-svn-id: svn://svn.code.sf.net/p/bitchx/code/trunk@139 13b04d17-f746-0410-82c6-800466cd88b0
2011-09-07 10:13:18 +00:00
Kevin Easton
736777bea3 Change instances of open-coded "3" in calls to prepare_command() with PC_SILENT macro.
git-svn-id: svn://svn.code.sf.net/p/bitchx/code/trunk@137 13b04d17-f746-0410-82c6-800466cd88b0
2011-09-06 06:48:57 +00:00
Kevin Easton
c89a718fa1 Change the channel mode flags from const ints in names.c to #define macros in names.h.
git-svn-id: svn://svn.code.sf.net/p/bitchx/code/trunk@134 13b04d17-f746-0410-82c6-800466cd88b0
2011-08-30 14:50:42 +00:00
Kevin Easton
b5741b6ee2 Add %G (halfop symbol) to the default status line.
Also change the meaning of %= in the status line so that the voice
symbol is shown whether or not the user is opped.


git-svn-id: svn://svn.code.sf.net/p/bitchx/code/trunk@50 13b04d17-f746-0410-82c6-800466cd88b0
2008-06-12 14:55:00 +00:00
Kevin Easton
533c3dbcbf Turn on SVN keyword replacement for $Date$, $Author$, $Revision$, $Id$ for all
*.c and *.h files.


git-svn-id: svn://svn.code.sf.net/p/bitchx/code/branches/ircii-pana-1.1@3 13b04d17-f746-0410-82c6-800466cd88b0
2008-02-25 09:49:14 +00:00
Kevin Easton
28febcfea9 Initial import of the ircii-pana-1.1-final source tree.
git-svn-id: svn://svn.code.sf.net/p/bitchx/code/tags/ircii-pana-1.1-final@1 13b04d17-f746-0410-82c6-800466cd88b0
2008-02-25 09:25:32 +00:00