|
23 | 23 | static int conn; /* connection socket */
|
24 | 24 | static int verb = 0; /* verbose output (e.g. raw stream) */
|
25 | 25 | static size_t cmax = 80; /* max number of chars per line */
|
26 |
| -static size_t gutl = 10; /* max char width of left column */ |
| 26 | +static size_t gutl = 20; /* max char width of left column */ |
27 | 27 | static char chan[CHA_MAX] = "kirc"; /* channel */
|
28 | 28 | static char * host = "irc.freenode.org"; /* irc host address */
|
29 | 29 | static char * port = "6667"; /* server port */
|
@@ -131,14 +131,14 @@ printw(const char *format, ...) {
|
131 | 131 |
|
132 | 132 | for (i = 0; line[i] == ' '; ++i) putchar(line[i]);
|
133 | 133 |
|
134 |
| - spaceleft = cmax + gutl - (i - 1); |
| 134 | + spaceleft = cmax - (i - 1); |
135 | 135 |
|
136 | 136 | for(tok = strtok(&line[i], " "); tok != NULL; tok = strtok(NULL, " ")) {
|
137 |
| - wordwidth = strlen(tok); |
| 137 | + wordwidth = strlen(tok) - 1; |
138 | 138 |
|
139 | 139 | if ((wordwidth + spacewidth) > spaceleft) {
|
140 |
| - printf("\n%*.s%s ", (int) gutl + 1, "", tok); |
141 |
| - spaceleft = cmax - (gutl + 1 + wordwidth); |
| 140 | + printf("\n%*.s%s ", (int) gutl + 1, " ", tok); |
| 141 | + spaceleft = cmax - (gutl + 1 + wordwidth + spacewidth); |
142 | 142 | } else {
|
143 | 143 | printf("%s ", tok);
|
144 | 144 | spaceleft = spaceleft - (wordwidth + spacewidth);
|
|
0 commit comments