static void put_iac_subopt_autologin(void)
{
int len = strlen(G.autologin) + 6; // (2 + 1 + 1 + strlen + 2)
- const char *user = "USER";
+ const char *p = "USER";
if (G.iaclen + len > IACBUFSIZE)
iac_flush();
put_iac(TELQUAL_IS);
put_iac(NEW_ENV_VAR);
- while (*user)
- put_iac(*user++);
+ while (*p)
+ put_iac(*p++);
put_iac(NEW_ENV_VALUE);
- while (*G.autologin)
- put_iac(*G.autologin++);
+ p = G.autologin;
+ while (*p)
+ put_iac(*p++);
put_iac(IAC);
put_iac(SE);
static void to_ttype(void)
{
/* Tell server we will (or won't) do TTYPE */
-
if (G.ttype)
put_iac2(WILL, TELOPT_TTYPE);
else
static void to_new_environ(void)
{
/* Tell server we will (or will not) do AUTOLOGIN */
-
if (G.autologin)
put_iac2(WILL, TELOPT_NEW_ENVIRON);
else
G.telstate = TS_SUB2;
#if ENABLE_FEATURE_TELNET_TTYPE
else
- if (c == TELOPT_TTYPE)
+ if (c == TELOPT_TTYPE && G.ttype)
put_iac_subopt(TELOPT_TTYPE, G.ttype);
#endif
#if ENABLE_FEATURE_TELNET_AUTOLOGIN
else
- if (c == TELOPT_NEW_ENVIRON)
+ if (c == TELOPT_NEW_ENVIRON && G.autologin)
put_iac_subopt_autologin();
#endif
break;