]> git.armaanb.net Git - sic.git/blobdiff - sic.c
Initial config changes
[sic.git] / sic.c
diff --git a/sic.c b/sic.c
index 6b5ae9685dc9482add84808e95a5c920cad0d170..c1e428effa57a8675c123f100d122a1971a210a2 100644 (file)
--- a/sic.c
+++ b/sic.c
@@ -1,4 +1,6 @@
  /* See LICENSE file for license details. */
+#include <sys/select.h>
+
 #include <ctype.h>
 #include <errno.h>
 #include <stdarg.h>
@@ -22,6 +24,8 @@ static char channel[256];
 static time_t trespond;
 static FILE *srv;
 
+#undef strlcpy
+#include "strlcpy.c"
 #include "util.c"
 
 static void
@@ -70,7 +74,7 @@ parsein(char *s) {
                return;
        }
        c = *++s;
-       if(c != '\0' && isspace(s[1])) {
+       if(c != '\0' && isspace((unsigned char)s[1])) {
                p = s + 2;
                switch(c) {
                case 'j':
@@ -181,6 +185,11 @@ main(int argc, char *argv[]) {
        fflush(srv);
        setbuf(stdout, NULL);
        setbuf(srv, NULL);
+       setbuf(stdin, NULL);
+#ifdef __OpenBSD__
+       if (pledge("stdio", NULL) == -1)
+               eprint("error: pledge:");
+#endif
        for(;;) { /* main loop */
                FD_ZERO(&rd);
                FD_SET(0, &rd);