attempt to fix utf8 conversion on linux

This commit is contained in:
Andrew Pamment 2017-04-23 13:03:37 +10:00
parent f8b6c4dc89
commit 0e16613143
3 changed files with 4 additions and 4 deletions

View File

@ -35,7 +35,7 @@ OBJ = inih/ini.o bbs.o main.o users.o main_menu.o mail_menu.o doors.o bbs_list.o
$(CC) -c -o $@ $< $(CFLAGS)
magicka: $(OBJ) ${LUA} ${ZMODEM} ${JAMLIB} ${JSMN}
$(CC) -o magicka -o $@ $^ $(CFLAGS) -L/usr/local/lib -lsqlite3 -lutil -lm -ldl -lssl -lcrypto -lssh -liconv
$(CC) -o magicka -o $@ $^ $(CFLAGS) -L/usr/local/lib -lsqlite3 -lutil -lm -ldl -lssl -lcrypto -lssh
magimail: $(JAMLIB)
cd utils/magimail && $(MAKE) linux

View File

@ -39,7 +39,7 @@ OBJ = deps/aha/aha.o inih/ini.o bbs.o main.o users.o main_menu.o mail_menu.o do
$(CC) -c -o $@ $< $(CFLAGS)
magicka: $(OBJ) ${LUA} ${JAMLIB} ${ZMODEM} ${B64} ${JSMN}
$(CC) -o magicka -o $@ $^ $(CFLAGS) -L/usr/local/lib -lsqlite3 -lutil -lm -ldl -lssl -lcrypto -lssh -liconv $(MICROHTTPD)
$(CC) -o magicka -o $@ $^ $(CFLAGS) -L/usr/local/lib -lsqlite3 -lutil -lm -ldl -lssl -lcrypto -lssh $(MICROHTTPD)
magimail: $(JAMLIB)
cd utils/magimail && $(MAKE) linux

4
bbs.c
View File

@ -246,7 +246,7 @@ void s_putchar(char c) {
if (sshBBS) {
fprintf(stdout, "%s", ptr1);
} else {
write(gSocket, ptr1, strlen(ptr1));
write(gSocket, ptr1, outbuf - ptr1);
}
iconv_close(ic);
free(ptr1);
@ -282,7 +282,7 @@ void s_putstring(char *c) {
if (sshBBS) {
fprintf(stdout, "%s", ptr1);
} else {
write(gSocket, ptr1, strlen(ptr1));
write(gSocket, ptr1, outbuf - ptr1);
}
iconv_close(ic);
free(ptr1);