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
This commit is contained in:
Tim Cava
2013-10-26 02:43:57 +00:00
parent e9ef2d4e55
commit 1d1cd09ee3

View File

@@ -976,26 +976,27 @@ static char my_buffer[] = "\f";
static char *status_notify_windows(Window *window)
{
int doneone = 0;
char buf2[MY_BUFFER+2];
static char my_buffer[MY_BUFFER/2+1];
char notes[MY_BUFFER + 2];
static char my_buffer[MY_BUFFER / 2 + 1];
if (get_int_var(SHOW_STATUS_ALL_VAR) || window == window->screen->current_window)
{
*buf2='\0';
*notes = 0;
window = NULL;
while ((traverse_all_windows(&window)))
{
if (window->miscflags & WINDOW_NOTIFIED)
{
if (doneone++)
strmcat(buf2, ",", MY_BUFFER/2);
strmcat(buf2, ltoa(window->refnum), MY_BUFFER/2);
strlcat(notes, ",", sizeof notes);
strlcat(notes, ltoa(window->refnum), sizeof notes);
}
}
}
if (doneone && window->wset->notify_format)
{
snprintf(my_buffer, MY_BUFFER/2, window->wset->notify_format, buf2);
return (my_buffer);
snprintf(my_buffer, sizeof my_buffer, window->wset->notify_format, notes);
return my_buffer;
}
RETURN_EMPTY;
}