diff -u ml4.i.orig ml4.i --- ml4.i.orig +++ ml4.i @@ -124,7 +124,10 @@ func ml4write(file,data,varname,mode,endian=) ncols=int(dims(3)); } - if (structof(data)==long) { type='l'; } + tmp = data; // otherwise data may be swapped in place in endian='L' + + // next line: fix from Thibaut Paumard for Debian. + if (structof(data)==long) { type='l'; tmp=int(tmp); } else if (structof(data)==int) { type='l'; } else if (structof(data)==float) { type='r'; } else if (structof(data)==double) { type='d'; } @@ -132,8 +135,6 @@ func ml4write(file,data,varname,mode,endian=) else if (structof(data)==char) { type='b'; } else error,"Unsupported type"; - tmp = data; // otherwise data may be swapped in place in endian='L' - status = matout(file,varname,&tmp,nrows,ncols,type,mode,endian); if (status) error,"write failed"; }