directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r528600 - /directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/syntax/JpegSyntaxChecker.java
Date Fri, 13 Apr 2007 19:14:03 GMT
Author: elecharny
Date: Fri Apr 13 12:14:02 2007
New Revision: 528600

URL: http://svn.apache.org/viewvc?view=rev&rev=528600
Log:
Fixed bad bytes comparisons, making the tests unhappy

Modified:
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/syntax/JpegSyntaxChecker.java

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/syntax/JpegSyntaxChecker.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/syntax/JpegSyntaxChecker.java?view=diff&rev=528600&r1=528599&r2=528600
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/syntax/JpegSyntaxChecker.java
(original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/syntax/JpegSyntaxChecker.java
Fri Apr 13 12:14:02 2007
@@ -88,15 +88,15 @@
             return false;
         }
 
-        if ( ( bytes[0] == (byte)0xFF ) && // SOI
-             ( bytes[1] == (byte)0xD8 ) &&
-             ( bytes[2] == (byte)0xFF ) && // APP0
-             ( bytes[3] == (byte)0xE0 ) &&
+        if ( ( bytes[0] == (byte)0x00FF ) && // SOI
+             ( bytes[1] == (byte)0x00D8 ) &&
+             ( bytes[2] == (byte)0x00FF ) && // APP0
+             ( bytes[3] == (byte)0x00E0 ) &&
              ( bytes[6] == 'J' ) && // JFIF
              ( bytes[7] == 'F' ) && // JFIF
              ( bytes[8] == 'I' ) && // JFIF
              ( bytes[9] == 'F' ) &&
-             ( bytes[10] == '\0' ) ) // \0
+             ( bytes[10] == 0x00 ) ) // \0
         {
             // Note : this is not because the header is correct
             // that the file is a jpeg file. There are much more



Mime
View raw message