]> git.mxchange.org Git - flightgear.git/commitdiff
returning addresses of auto vars is *dangerous* (ask Vasilii! :-)
authormfranz <mfranz>
Fri, 2 Dec 2005 00:10:25 +0000 (00:10 +0000)
committermfranz <mfranz>
Fri, 2 Dec 2005 00:10:25 +0000 (00:10 +0000)
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 ...

src/MultiPlayer/tiny_xdr.cxx

index ff572f8cc9b364688942c0b3ba89fd03b34e8064..38e178409e837afade776199bd12ca559effbd4e 100644 (file)
@@ -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;