5
0
mirror of https://github.com/cwinfo/matterbridge.git synced 2024-11-24 17:51:36 +00:00

Limit number of columns to number of IRC nicks.

Don't add more columns to the IRC nicks table than the total number of
nicks in the IRC channel.
This commit is contained in:
Fredrik de Vibe 2016-03-18 18:13:17 -04:00
parent a53e699112
commit 3fcce2d8a0

View File

@ -83,7 +83,7 @@ func tableformatter (nicks_s string, nicksPerRow int) string {
nicksPerRow = 4 nicksPerRow = 4
} }
for i := 0; i < 2; i++ { for i := 0; i < 2; i++ {
for j := 1; j <= nicksPerRow; j++ { for j := 1; j <= nicksPerRow && j <= len(nicks); j++ {
if i == 0 { if i == 0 {
result += "|" result += "|"
} else { } else {