|
|
fbcb50 |
diff --git a/telnet/utilities.c b/telnet/utilities.c
|
|
|
fbcb50 |
index 0bb0eab..d89ca37 100644
|
|
|
fbcb50 |
--- a/telnet/utilities.c
|
|
|
fbcb50 |
+++ b/telnet/utilities.c
|
|
|
fbcb50 |
@@ -748,6 +748,7 @@ printsub(char direction, unsigned char *pointer, int length)
|
|
|
fbcb50 |
env_common:
|
|
|
fbcb50 |
{
|
|
|
fbcb50 |
register int noquote = 2;
|
|
|
fbcb50 |
+ char* msg;
|
|
|
fbcb50 |
#if defined(ENV_HACK) && defined(OLD_ENVIRON)
|
|
|
fbcb50 |
extern int old_env_var, old_env_value;
|
|
|
fbcb50 |
#endif
|
|
|
fbcb50 |
@@ -758,14 +759,24 @@ printsub(char direction, unsigned char *pointer, int length)
|
|
|
fbcb50 |
/* case NEW_ENV_OVAR: */
|
|
|
fbcb50 |
if (pointer[0] == TELOPT_OLD_ENVIRON) {
|
|
|
fbcb50 |
# ifdef ENV_HACK
|
|
|
fbcb50 |
- if (old_env_var == OLD_ENV_VALUE)
|
|
|
fbcb50 |
- fprintf(NetTrace, "\" (VALUE) " + noquote);
|
|
|
fbcb50 |
- else
|
|
|
fbcb50 |
+ if (old_env_var == OLD_ENV_VALUE) {
|
|
|
fbcb50 |
+ msg = "\" (VALUE) ";
|
|
|
fbcb50 |
+ fprintf(NetTrace, "%s", msg + noquote);
|
|
|
fbcb50 |
+ }
|
|
|
fbcb50 |
+ else {
|
|
|
fbcb50 |
# endif
|
|
|
fbcb50 |
- fprintf(NetTrace, "\" VAR " + noquote);
|
|
|
fbcb50 |
+ msg = "\" VAR ";
|
|
|
fbcb50 |
+ fprintf(NetTrace, "%s", msg + noquote);
|
|
|
fbcb50 |
+# ifdef ENV_HACK
|
|
|
fbcb50 |
+ }
|
|
|
fbcb50 |
+#endif /*ENV_HACK*/
|
|
|
fbcb50 |
} else
|
|
|
fbcb50 |
#endif /* OLD_ENVIRON */
|
|
|
fbcb50 |
- fprintf(NetTrace, "\" VALUE " + noquote);
|
|
|
fbcb50 |
+ msg = "\" VALUE ";
|
|
|
fbcb50 |
+ fprintf(NetTrace, "%s", msg + noquote);
|
|
|
fbcb50 |
+#ifdef OLD_ENVIRON
|
|
|
fbcb50 |
+ }
|
|
|
fbcb50 |
+#endif /* OLD_ENVIRON */
|
|
|
fbcb50 |
noquote = 2;
|
|
|
fbcb50 |
break;
|
|
|
fbcb50 |
|
|
|
fbcb50 |
@@ -774,24 +785,36 @@ printsub(char direction, unsigned char *pointer, int length)
|
|
|
fbcb50 |
/* case OLD_ENV_VALUE: */
|
|
|
fbcb50 |
if (pointer[0] == TELOPT_OLD_ENVIRON) {
|
|
|
fbcb50 |
# ifdef ENV_HACK
|
|
|
fbcb50 |
- if (old_env_value == OLD_ENV_VAR)
|
|
|
fbcb50 |
- fprintf(NetTrace, "\" (VAR) " + noquote);
|
|
|
fbcb50 |
- else
|
|
|
fbcb50 |
+ if (old_env_value == OLD_ENV_VAR) {
|
|
|
fbcb50 |
+ msg = "\" (VAR) ";
|
|
|
fbcb50 |
+ fprintf(NetTrace, "%s", msg + noquote);
|
|
|
fbcb50 |
+ }
|
|
|
fbcb50 |
+ else {
|
|
|
fbcb50 |
# endif
|
|
|
fbcb50 |
- fprintf(NetTrace, "\" VALUE " + noquote);
|
|
|
fbcb50 |
- } else
|
|
|
fbcb50 |
+ msg = "\" VALUE ";
|
|
|
fbcb50 |
+ fprintf(NetTrace, "%s", msg + noquote);
|
|
|
fbcb50 |
+# ifdef ENV_HACK
|
|
|
fbcb50 |
+ }
|
|
|
fbcb50 |
+# endif
|
|
|
fbcb50 |
+ } else {
|
|
|
fbcb50 |
#endif /* OLD_ENVIRON */
|
|
|
fbcb50 |
- fprintf(NetTrace, "\" VAR " + noquote);
|
|
|
fbcb50 |
+ msg = "\" VAR ";
|
|
|
fbcb50 |
+ fprintf(NetTrace, "%s", msg + noquote);
|
|
|
fbcb50 |
+#ifdef OLD_ENVIRON
|
|
|
fbcb50 |
+ }
|
|
|
fbcb50 |
+#endif
|
|
|
fbcb50 |
noquote = 2;
|
|
|
fbcb50 |
break;
|
|
|
fbcb50 |
|
|
|
fbcb50 |
case ENV_ESC:
|
|
|
fbcb50 |
- fprintf(NetTrace, "\" ESC " + noquote);
|
|
|
fbcb50 |
+ msg = "\" ESC ";
|
|
|
fbcb50 |
+ fprintf(NetTrace, "%s", msg + noquote);
|
|
|
fbcb50 |
noquote = 2;
|
|
|
fbcb50 |
break;
|
|
|
fbcb50 |
|
|
|
fbcb50 |
case ENV_USERVAR:
|
|
|
fbcb50 |
- fprintf(NetTrace, "\" USERVAR " + noquote);
|
|
|
fbcb50 |
+ msg = "\" USERVAR ";
|
|
|
fbcb50 |
+ fprintf(NetTrace, "%s", msg + noquote);
|
|
|
fbcb50 |
noquote = 2;
|
|
|
fbcb50 |
break;
|
|
|
fbcb50 |
|
|
|
fbcb50 |
diff --git a/telnetd/utility.c b/telnetd/utility.c
|
|
|
fbcb50 |
index 4a438be..82edee5 100644
|
|
|
fbcb50 |
--- a/telnetd/utility.c
|
|
|
fbcb50 |
+++ b/telnetd/utility.c
|
|
|
fbcb50 |
@@ -969,22 +969,26 @@ printsub(char direction, unsigned char *pointer, int length)
|
|
|
fbcb50 |
env_common:
|
|
|
fbcb50 |
{
|
|
|
fbcb50 |
register int noquote = 2;
|
|
|
fbcb50 |
+ char* msg;
|
|
|
fbcb50 |
for (i = 2; i < length; i++ ) {
|
|
|
fbcb50 |
switch (pointer[i]) {
|
|
|
fbcb50 |
case ENV_VAR:
|
|
|
fbcb50 |
if (pointer[1] == TELQUAL_SEND)
|
|
|
fbcb50 |
goto def_case;
|
|
|
fbcb50 |
- netoprintf("\" VAR " + noquote);
|
|
|
fbcb50 |
+ msg = "\" VAR ";
|
|
|
fbcb50 |
+ netoprintf("%s", msg + noquote);
|
|
|
fbcb50 |
noquote = 2;
|
|
|
fbcb50 |
break;
|
|
|
fbcb50 |
|
|
|
fbcb50 |
case ENV_VALUE:
|
|
|
fbcb50 |
- netoprintf("\" VALUE " + noquote);
|
|
|
fbcb50 |
+ msg = "\" VALUE ";
|
|
|
fbcb50 |
+ netoprintf("%s", msg + noquote);
|
|
|
fbcb50 |
noquote = 2;
|
|
|
fbcb50 |
break;
|
|
|
fbcb50 |
|
|
|
fbcb50 |
case ENV_ESC:
|
|
|
fbcb50 |
- netoprintf("\" ESC " + noquote);
|
|
|
fbcb50 |
+ msg = "\" ESC ";
|
|
|
fbcb50 |
+ netoprintf("%s", msg + noquote);
|
|
|
fbcb50 |
noquote = 2;
|
|
|
fbcb50 |
break;
|
|
|
fbcb50 |
|