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().
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
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
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