]> git.saurik.com Git - apt.git/commitdiff
Fixes from Christoph Pfisterer
authorArch Librarian <arch@canonical.com>
Mon, 20 Sep 2004 16:58:41 +0000 (16:58 +0000)
committerArch Librarian <arch@canonical.com>
Mon, 20 Sep 2004 16:58:41 +0000 (16:58 +0000)
Author: jgg
Date: 2001-10-04 05:13:23 GMT
Fixes from Christoph Pfisterer

apt-pkg/tagfile.cc
apt-pkg/tagfile.h

index 49330bad51b41ff29fb6ebef907ce17cfa547409..45913877d008a038f6bea3ac3ec3893e27a68996 100644 (file)
@@ -1,6 +1,6 @@
 // -*- mode: cpp; mode: fold -*-
 // Description                                                         /*{{{*/
-// $Id: tagfile.cc,v 1.30 2001/05/14 05:56:26 jgg Exp $
+// $Id: tagfile.cc,v 1.31 2001/10/04 05:13:23 jgg Exp $
 /* ######################################################################
 
    Fast scanner for RFC-822 type header information
@@ -197,7 +197,7 @@ bool pkgTagSection::Scan(const char *Start,unsigned long MaxLength)
       return false;
    
    TagCount = 0;
-   while (TagCount < sizeof(Indexes)/sizeof(Indexes[0]) && Stop < End)
+   while (TagCount+1 < sizeof(Indexes)/sizeof(Indexes[0]) && Stop < End)
    {
       // Start a new index and add it to the hash
       if (isspace(Stop[0]) == 0)
@@ -211,13 +211,13 @@ bool pkgTagSection::Scan(const char *Start,unsigned long MaxLength)
       if (Stop == 0)
         return false;
       
-      for (; Stop[1] == '\r' && Stop+1 < End; Stop++);
+      for (;  Stop+1 < End && Stop[1] == '\r'; Stop++);
 
       // Double newline marks the end of the record
       if (Stop+1 < End && Stop[1] == '\n')
       {
         Indexes[TagCount] = Stop - Section;
-        for (; (Stop[0] == '\n' || Stop[0] == '\r') && Stop < End; Stop++);
+        for (; Stop < End && (Stop[0] == '\n' || Stop[0] == '\r'); Stop++);
         return true;
       }
       
index f7f1bb42cf645e8a16523e8b6a2b4f68c1a429f4..86faac16c3b741c9e0c57175b59ab294004abcee 100644 (file)
@@ -1,6 +1,6 @@
 // -*- mode: cpp; mode: fold -*-
 // Description                                                         /*{{{*/
-// $Id: tagfile.h,v 1.17 2001/04/22 05:42:52 jgg Exp $
+// $Id: tagfile.h,v 1.18 2001/10/04 05:13:23 jgg Exp $
 /* ######################################################################
 
    Fast scanner for RFC-822 type header information
@@ -34,7 +34,7 @@ class pkgTagSection
    
    // We have a limit of 256 tags per section.
    unsigned short Indexes[256];
-   unsigned short AlphaIndexes[0xff];
+   unsigned short AlphaIndexes[0x100];
    
    unsigned int TagCount;