X-Git-Url: https://git.armaanb.net/?p=sic.git;a=blobdiff_plain;f=sic.c;h=c1e428effa57a8675c123f100d122a1971a210a2;hp=ce6d2160020c9287e07eb796da22a5abe473db5e;hb=HEAD;hpb=7f0141bbe92dc6c3423ff39d21e8ec5c18b58ec1 diff --git a/sic.c b/sic.c index ce6d216..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': @@ -182,6 +186,10 @@ main(int argc, char *argv[]) { 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);