diff options
author | TingPing <tingping@tingping.se> | 2013-10-04 17:00:56 -0400 |
---|---|---|
committer | TingPing <tingping@tingping.se> | 2013-10-04 17:00:56 -0400 |
commit | e10faa0369d498eff12c9f9536d0b81c944a339c (patch) | |
tree | 8945a72d50e6edf49f3b73123b59cbbb054919fc /src/common/notify.c | |
parent | 4ec0e6fd0525cca22fb28e80caf0c5b473c965b1 (diff) |
Fix crash with long notify lists.
Diffstat (limited to 'src/common/notify.c')
-rw-r--r-- | src/common/notify.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/common/notify.c b/src/common/notify.c index f1439140..33aa7aaa 100644 --- a/src/common/notify.c +++ b/src/common/notify.c @@ -394,8 +394,11 @@ notify_flush_watches (server * serv, GSList *from, GSList *end) while (list != end) { notify = list->data; - serv->supports_monitor ? strcat (tbuf, ",") : strcat (tbuf, " +"); - strcat (tbuf, notify->name); + if (serv->supports_monitor) + g_strlcat (tbuf, ",", sizeof(tbuf)); + else + g_strlcat (tbuf, " +", sizeof(tbuf)); + g_strlcat (tbuf, notify->name, sizeof(tbuf)); list = list->next; } serv->p_raw (serv, tbuf); |