void userlist(CtdlIPC * ipc, char *patn) {
char buf[SIZ];
- char fl[SIZ];
+ char fl[26]; // a buffer this small will prevent it overrunning the column
struct tm tmbuf;
time_t lc;
int r; // IPC response code
if ((cmd == 0) || (cmd == 1)) {
tcgetattr(0, &live);
+
+ // Character-by-character input instead of line mode
live.c_iflag = ISTRIP | IXON | IXANY;
live.c_oflag = OPOST | ONLCR;
live.c_lflag = ISIG | NOFLSH;
+ // Key bindings
live.c_cc[VINTR] = 0;
live.c_cc[VQUIT] = 0;
-
- // do we even need this stuff anymore?
- // live.c_line=0;
live.c_cc[VERASE] = 8;
live.c_cc[VKILL] = 24;
live.c_cc[VEOF] = 1;
live.c_cc[VSTART] = 0;
tcsetattr(0, TCSADRAIN, &live);
}
+
if (cmd == 2) {
tcgetattr(0, &saved_settings);
}
+
if (cmd == 3) {
tcsetattr(0, TCSADRAIN, &saved_settings);
}