From: mfranz Date: Fri, 2 Dec 2005 00:10:25 +0000 (+0000) Subject: returning addresses of auto vars is *dangerous* (ask Vasilii! :-) X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=b716c6d15b7a6e2e0c957ec6640c08c6d9706daa;p=flightgear.git returning addresses of auto vars is *dangerous* (ask Vasilii! :-) This was the reason why some people (especially SuSE10.0/gcc 4.0.2 users) couldn't see others in MP. I don't even know why I'm committing that. It's less important than taxi lights ... --- diff --git a/src/MultiPlayer/tiny_xdr.cxx b/src/MultiPlayer/tiny_xdr.cxx index ff572f8cc..38e178409 100644 --- a/src/MultiPlayer/tiny_xdr.cxx +++ b/src/MultiPlayer/tiny_xdr.cxx @@ -132,7 +132,7 @@ float XDR_decode_float ( const xdr_data_t & f_Val ) { float* tmp; - xdr_data_t dummy; + static xdr_data_t dummy; dummy = XDR_decode_int32 (f_Val); tmp = (float*) &dummy; @@ -153,7 +153,7 @@ double XDR_decode_double ( const xdr_data2_t & d_Val ) { double* tmp; - xdr_data2_t dummy; + static xdr_data2_t dummy; dummy = XDR_decode_int64 (d_Val); tmp = (double*) &dummy;