]> git.saurik.com Git - apt.git/blobdiff - apt-pkg/contrib/mmap.cc
* merged from dpkg-log
[apt.git] / apt-pkg / contrib / mmap.cc
index bc22fba6766684aec2f84f1b88d2dfbd44ca952d..88e71e8e348074e5cb5cef1a09b9d69e043813eb 100644 (file)
    ##################################################################### */
                                                                        /*}}}*/
 // Include Files                                                       /*{{{*/
-#ifdef __GNUG__
-#pragma implementation "apt-pkg/mmap.h"
-#endif 
-
 #define _BSD_SOURCE
 #include <apt-pkg/mmap.h>
 #include <apt-pkg/error.h>
@@ -155,9 +151,9 @@ DynamicMMap::DynamicMMap(FileFd &F,unsigned long Flags,unsigned long WorkSpace)
    unsigned long EndOfFile = Fd->Size();
    if (EndOfFile > WorkSpace)
       WorkSpace = EndOfFile;
-   else
+   else if(WorkSpace > 0)
    {
-      Fd->Seek(WorkSpace);
+      Fd->Seek(WorkSpace - 1);
       char C = 0;
       Fd->Write(&C,sizeof(C));
    }