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

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