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:
@@ -555,18 +555,14 @@ int in_rhs = 0,
|
|||||||
|
|
||||||
char *stat_convert_format(Window *win, char *form)
|
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;
|
char *ptr = form;
|
||||||
int pos = 0;
|
unsigned char buffer[2 * BIG_BUFFER_SIZE + 1];
|
||||||
int map;
|
|
||||||
char key;
|
|
||||||
int i;
|
|
||||||
|
|
||||||
|
|
||||||
if (!form || !*form)
|
if (!form || !*form)
|
||||||
return m_strdup(empty_string);
|
return m_strdup(empty_string);
|
||||||
*buffer = 0;
|
|
||||||
|
|
||||||
|
*buffer = 0;
|
||||||
while (*ptr && pos < (2 * BIG_BUFFER_SIZE) - 4)
|
while (*ptr && pos < (2 * BIG_BUFFER_SIZE) - 4)
|
||||||
{
|
{
|
||||||
if (*ptr != '%')
|
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)
|
if (status_expandos[i].map != map || status_expandos[i].key != key)
|
||||||
continue;
|
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);
|
pos = strlen(buffer);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user