X-Git-Url: https://jfr.im/git/solanum.git/blobdiff_plain/550e851c5eee26dad124e3caa6e60b07ea575d5a..c1b01bf5ec318463ab076ac2d7c0a4b02631f745:/modules/m_map.c diff --git a/modules/m_map.c b/modules/m_map.c index 8675fed8..d6aa971c 100644 --- a/modules/m_map.c +++ b/modules/m_map.c @@ -108,7 +108,7 @@ dump_map(struct Client *client_p, struct Client *root_p, char *pbuf) } frac = (1000 * rb_dlink_list_length(&root_p->serv->users) + Count.total / 2) / Count.total; - snprintf(buf + USER_COL, BUFSIZE - USER_COL, + snprintf(buf + USER_COL, sizeof buf - USER_COL, " | Users: %5lu (%2d.%1d%%)", rb_dlink_list_length(&root_p->serv->users), frac / 10, frac % 10); @@ -157,7 +157,7 @@ flattened_map(struct Client *client_p) rb_dlink_node *ptr; struct Client *target_p; int i, len; - int cnt = 0; + unsigned long cnt = 0; /* First display me as the root */ rb_strlcpy(buf, me.name, BUFSIZE); @@ -172,7 +172,7 @@ flattened_map(struct Client *client_p) } } - snprintf(buf + USER_COL, BUFSIZE - USER_COL, + snprintf(buf + USER_COL, sizeof buf - USER_COL, " | Users: %5lu (%4.1f%%)", rb_dlink_list_length(&me.serv->users), 100 * (float) rb_dlink_list_length(&me.serv->users) / (float) Count.total); @@ -210,7 +210,7 @@ flattened_map(struct Client *client_p) } } - snprintf(buf + USER_COL, BUFSIZE - USER_COL, + snprintf(buf + USER_COL, sizeof buf - USER_COL, " | Users: %5lu (%4.1f%%)", rb_dlink_list_length(&target_p->serv->users), 100 * (float) rb_dlink_list_length(&target_p->serv->users) / (float) Count.total);