Fix MCCP bug caused by improper buffer management.

With great power comes great responsibility!


On Thu, Aug 28, 2014 at 1:17 PM, Stephen Lyons <notifications@github.com>
wrote:

> In src/ctelnet.h:
>
> > @@ -145,7 +145,7 @@ public slots:
> >  private:
> >                        cTelnet(){}
> >      void              initStreamDecompressor();
> > -    int               decompressBuffer( char * dirtyBuffer, int length );
> > +    int               decompressBuffer( char *& in_buffer, int& length, char* out_buffer );
> >      void              reset();
> >      void              connectionFailed();
> >
>
> Well, as a competitively new person to C++, I learnt something new today:
> that you CAN have a reference to a pointer BUT NOT the reverse. I guess I
> sorta confused the '&' as the reference operator with the '*' as the
> dereference operator so that they'd cancel each other out - but that's the
> fun of using pointers in 'C', if you don't clearly understand what is going
> on you can easily shoot yourself in the leg and if you get it badly wrong
> you can take off others' legs as well... [image: :boom:]
>
> —
> Reply to this email directly or view it on GitHub
> <https://github.com/Mudlet/Mudlet/pull/101/files#r16853746>.
>