|
16 | 16 | #define CHA_MAX 200 /* gauranteed max channel length */
|
17 | 17 |
|
18 | 18 | static int conn; /* connection socket */
|
19 |
| -size_t int verb = 0; /* verbose output (e.g. raw stream) */ |
20 |
| -size_t int cmax = 80; /* max number of chars per line */ |
21 |
| -size_t int gutl = 10; /* max char width of left column */ |
| 19 | +static size_t verb = 0; /* verbose output (e.g. raw stream) */ |
| 20 | +static size_t cmax = 80; /* max number of chars per line */ |
| 21 | +static size_t gutl = 10; /* max char width of left column */ |
22 | 22 | static char * host = "irc.freenode.org"; /* irc host address */
|
23 | 23 | static char * chan = "kisslinux"; /* channel */
|
24 | 24 | static char * port = "6667"; /* server port */
|
@@ -61,7 +61,7 @@ raw(char *fmt, ...) {
|
61 | 61 |
|
62 | 62 | if (verb) printf("<< %s", cmd_str);
|
63 | 63 | if (olog) printa(cmd_str);
|
64 |
| - if (write(conn, cmd_str, strlen(cmd_str)) < 0) error(1); |
| 64 | + if (write(conn, cmd_str, strlen(cmd_str)) < 0) exit(1); |
65 | 65 |
|
66 | 66 | free(cmd_str);
|
67 | 67 | }
|
@@ -107,7 +107,7 @@ printw(const char *format, ...) {
|
107 | 107 | for(tok = strtok(&line[i], " "); tok != NULL; tok = strtok(NULL, " ")) {
|
108 | 108 | wordwidth = strlen(tok);
|
109 | 109 | if ((wordwidth + spacewidth) > spaceleft) {
|
110 |
| - printf("\n%*.s%s", gutl + 2, "", tok); |
| 110 | + printf("\n%*.s%s", (int) gutl + 2, "", tok); |
111 | 111 | spaceleft = cmax - (gutl + 2 + wordwidth);
|
112 | 112 | } else {
|
113 | 113 | printf(" %s", tok);
|
@@ -212,7 +212,7 @@ main(int argc, char **argv) {
|
212 | 212 | if (!kbhit()) dprintf(fd[1], "/\n");
|
213 | 213 | else {
|
214 | 214 | tcsetattr(STDIN_FILENO, TCSANOW, &tp);
|
215 |
| - if (fgets(usrin, len, stdin) == NULL) return 1; |
| 215 | + if (fgets(usrin, MSG_MAX, stdin) == NULL) return 1; |
216 | 216 | tcsetattr(STDIN_FILENO, TCSANOW, &save);
|
217 | 217 |
|
218 | 218 | if (sscanf(usrin, "/%[m] %s %[^\n]\n", &c1, v2, v1) == 3 ||
|
|
0 commit comments