classpath-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [cp-patches] [Patch] java.util.zip - GZIP_MAGIC fixed


From: Tom Tromey
Subject: Re: [cp-patches] [Patch] java.util.zip - GZIP_MAGIC fixed
Date: 12 Oct 2004 11:50:14 -0600
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3.50

>>>>> "Michael" == Michael Koch <address@hidden> writes:

Michael> -    magic = in.read();
Michael>      if (magic != (GZIP_MAGIC & 0xff))
Michael>        throw new IOException("Error in GZIP header, second byte 
doesn't match");
Michael> +    
Michael> +    magic = in.read();
Michael> +    if (magic != (GZIP_MAGIC >> 8))
Michael> +      throw new IOException("Error in GZIP header, first byte doesn't 
match");

The messages are now in the wrong order.
However, rather than fixing the messages, I think it is probably
clearer to combine the checks and report that the magic number (as a
whole) is incorrect.

Tom




reply via email to

[Prev in Thread] Current Thread [Next in Thread]