www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Bug 192] New: std.zip produces invalid archives on BigEndian targets

reply d-bugmail puremagic.com writes:
http://d.puremagic.com/bugzilla/show_bug.cgi?id=192

           Summary: std.zip produces invalid archives on BigEndian targets
           Product: D
           Version: 0.160
          Platform: All
        OS/Version: All
            Status: NEW
          Keywords: patch
          Severity: normal
          Priority: P2
         Component: Phobos
        AssignedTo: bugzilla digitalmars.com
        ReportedBy: dvdfrdmn users.sf.net


There is a bug in ZipAarchive.putUshort, but it is only triggered on BigEndian
targets.  Fix:

        }
        else
        {
-           data[0] = cast(ubyte)us;
-           data[1] = cast(ubyte)(us >> 8);
+           data[i] = cast(ubyte)us;
+           data[i + 1] = cast(ubyte)(us >> 8);
        }
     }


-- 
Jun 11 2006
parent Walter Bright <newshound digitalmars.com> writes:
I certainly like bug reports that come with the fix included. Thanks!
Jun 12 2006