Browse Source

* fcl-db/dbase: fix for dbf_common Memscan fixes DBase3 memo issues. Thanks to J.G. Johansen

git-svn-id: trunk@24264 -
reiniero 12 years ago
parent
commit
1b942b52d4
1 changed files with 3 additions and 1 deletions
  1. 3 1
      packages/fcl-db/src/dbase/dbf_common.pas

+ 3 - 1
packages/fcl-db/src/dbase/dbf_common.pas

@@ -408,7 +408,9 @@ function MemScan(const Buffer: Pointer; Chr: Byte; Length: Integer): Pointer;
 var
   I: Integer;
 begin
-  I := System.IndexByte(Buffer, Length, Chr);
+  // Make sure we pass a buffer of bytes instead of a pchar otherwise
+  // the call will always fail
+  I := System.IndexByte(PByte(Buffer)^, Length, Chr);
   if I = -1 then
     Result := nil
   else