unsigned short ypixels; /* pixels */
} xwinsz;
- if (scr_set_windowsize())
- return;
-
if (have_xterm) { /* dynamically size screen if on an xterm */
if (ioctl(0, TIOCGWINSZ, &xwinsz) == 0) {
if (xwinsz.height)
- screenheight = (int) xwinsz.height;
+ screenheight = is_curses_enabled() ? (int)xwinsz.height - 1 : (int) xwinsz.height;
if (xwinsz.width)
screenwidth = (int) xwinsz.width;
}
return argc;
}
+static void statusHook(char *s) {
+ sln_printf(s);
+ sln_flush();
+}
+
/*
* main
*/
char hexstring[MD5_HEXSTRING_SIZE];
int stored_password = 0;
char password[SIZ];
+
+ setIPCDeathHook(screen_delete);
+ setIPCErrorPrintf(err_printf);
+ setCryptoStatusHook(statusHook);
/* Permissions sanity check - don't run citadel setuid/setgid */
if (getuid() != geteuid()) {
sttybbs(SB_NO_INTR); /* Install the new ones */
signal(SIGHUP, dropcarr); /* Cleanup gracefully if carrier is dropped */
signal(SIGTERM, dropcarr); /* Cleanup gracefully if terminated */
- signal(SIGCONT, catch_sigcont); /* Catch SIGCONT so we can reset terminal */
+ signal(SIGCONT, catch_sigcont); /* Catch SIGCONT so we can reset terminal */
+#ifdef SIGWINCH
+ signal(SIGWINCH, scr_winch); /* Window resize signal */
+#endif
#ifdef HAVE_OPENSSL
arg_encrypt = RC_DEFAULT;
serv_gets(aaa);
if (nonce[0])
{
- sprintf(aaa, "PAS2 %s", make_apop_string(password, nonce, hexstring));
+ snprintf(aaa, sizeof aaa, "PAS2 %s", make_apop_string(password, nonce, hexstring, sizeof hexstring));
}
else /* Else no APOP */
{
if (nonce[0])
{
- sprintf(aaa, "PAS2 %s", make_apop_string(password, nonce, hexstring));
+ snprintf(aaa, sizeof aaa, "PAS2 %s", make_apop_string(password, nonce, hexstring, sizeof hexstring));
}
else /* Else no APOP */
{
- snprintf(aaa, sizeof(aaa)-1, "PASS %s", password);
+ snprintf(aaa, sizeof aaa, "PASS %s", password);
}
serv_puts(aaa);