X-Git-Url: https://git.armaanb.net/?p=sic.git;a=blobdiff_plain;f=sic.c;h=c1e428effa57a8675c123f100d122a1971a210a2;hp=6b5ae9685dc9482add84808e95a5c920cad0d170;hb=HEAD;hpb=6703fe45923e62fdad4ebdcc25c7df7dddbe1db8 diff --git a/sic.c b/sic.c index 6b5ae96..c1e428e 100644 --- a/sic.c +++ b/sic.c @@ -1,4 +1,6 @@ /* See LICENSE file for license details. */ +#include + #include #include #include @@ -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);