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
This commit is contained in:
Tim Cava
2013-10-26 02:28:13 +00:00
parent 26e070565e
commit fdb83238de

View File

@@ -555,18 +555,14 @@ int in_rhs = 0,
char *stat_convert_format(Window *win, char *form)
{
unsigned char buffer[2 * BIG_BUFFER_SIZE + 1];
int map, key, i, pos = 0;
char *ptr = form;
int pos = 0;
int map;
char key;
int i;
unsigned char buffer[2 * BIG_BUFFER_SIZE + 1];
if (!form || !*form)
return m_strdup(empty_string);
*buffer = 0;
*buffer = 0;
while (*ptr && pos < (2 * BIG_BUFFER_SIZE) - 4)
{
if (*ptr != '%')
@@ -600,7 +596,7 @@ unsigned char buffer[2 * BIG_BUFFER_SIZE + 1];
{
if (status_expandos[i].map != map || status_expandos[i].key != key)
continue;
strmcat(buffer, (status_expandos[i].callback_function)(win), BIG_BUFFER_SIZE);
strlcat(buffer, status_expandos[i].callback_function(win), sizeof buffer);
pos = strlen(buffer);
break;
}