@@ -727,16 +727,16 @@ void CMUSHclientDoc::Handle_TELOPT_TERMINAL_TYPE ()
727
727
// see: RFC 930 and RFC 1060
728
728
// also see: http://tintin.sourceforge.net/mtts/
729
729
730
- unsigned char p1 [] = { IAC, SB, TELOPT_TERMINAL_TYPE, TTYPE_IS };
731
- unsigned char p2 [] = { IAC, SE };
730
+ unsigned char p1 [4 ] = { IAC, SB, TELOPT_TERMINAL_TYPE, TTYPE_IS };
731
+ unsigned char p2 [2 ] = { IAC, SE };
732
732
unsigned char sResponse [40 ];
733
733
int iLength = 0 ;
734
734
735
735
// build up response, eg. IAC, SB, TELOPT_TERMINAL_TYPE, 0, "MUSHCLIENT", IAC, SE
736
736
737
737
// preamble
738
- memcpy (sResponse , p1, sizeof p1 );
739
- iLength += sizeof p1 ;
738
+ memcpy (sResponse , p1, 4 );
739
+ iLength += 4 ;
740
740
741
741
// ensure max of 20 so we don't overflow the field
742
742
CString strTemp;
@@ -792,12 +792,12 @@ void CMUSHclientDoc::Handle_TELOPT_TERMINAL_TYPE ()
792
792
793
793
} // end of switch
794
794
795
- memcpy (&sResponse [iLength], strTemp, strTemp.GetLength ());
795
+ memcpy (&sResponse [iLength], (LPCTSTR) strTemp, strTemp.GetLength ());
796
796
iLength += strTemp.GetLength ();
797
797
798
798
// postamble
799
- memcpy (&sResponse [iLength], p2, sizeof p2 );
800
- iLength += sizeof p2 ;
799
+ memcpy (&sResponse [iLength], p2, 2 );
800
+ iLength += 2 ;
801
801
802
802
SendPacket (sResponse , iLength);
803
803
0 commit comments