title: Telnet: How to remove NULL (0x00) after every CR (0x0d) on send, using char mode (interactive mode)?
body: <p>I am using my open source Serial-to-IP converter (Serial Network Interface, SNI) to communicate with headless Slackware server using ttyS0 console. SNI during connection sends back to Telnet command set <code>ff fb 01 ff fb 03</code>. This turns Telnet from Line mode to Char mode. But i notice that Telnet replaces (adds) my CR press (0x0d) to two chars <code>0x0d 0x00</code>. The Slackware's TTY itself is immune to this, but some commands i run under it, at least <code>cat</code> and <code>mcedit</code>, are not. So i try to do the following:</p>
  
  <ol>
  <li>Insert filter in my SNI so it just throw away NULLs at direction IP->Serial. It works, but it quite ugly, because no binary transfer will be allowed anymore.</li>
  <li><p>Modify Telnet's source code to remove addind NULL to CR:</p>
  
  <pre><code>inetutils-1.9.4/telnet/telnet.c  from line 2294:
          case '\r':
            if (!crlf)
          {
            NETADD ('\r'); &lt;-- added
  //        NET2ADD ('\r', '\0'); &lt;-- removed
          }
            else
          {
            NET2ADD ('\r', '\n');
          }
            bol = flushline = 1;
            break;
  </code></pre></li>
  </ol>
  
  <p>It also work, so i ensure i am on the right way catching the problem.
  But it is also ugly due to multiple reasons, include that it is quite not portable, and obligate me to have my own non-standard telnet binary.</p>
  
  <p>So the question is: It is possible to command to Telnet not to modify my CRs? (looking at this source code piece, it is not possible at all with original code, but i am sure i miss something, and this should be possible without modify source code). Note: Replace 0x0d to 0x0d, 0x0a (this is present in code) will not work with Linux TTY: it interprets this as two CRs.</p>
  
  <p>And sub-question is: Where is 0x0d+0x00 used at all? I do not know any hardware device, teletype machine, etc., and any TTY, where NULL after CR used, at all. Thanks.</p>