$NetBSD: patch-ae,v 1.1 2007/10/21 03:53:45 dsainty Exp $

Correctly terminate default string values on NUL.

--- libflatfile/DB.cpp.orig	2003-06-20 11:37:46.000000000 +1200
+++ libflatfile/DB.cpp	2007-10-12 17:57:05.000000000 +1300
@@ -275,7 +276,8 @@
         switch (type) {
 
             case PalmLib::FlatFile::Field::STRING:
-            theReturn << std::string((const char *)chunk.data()+2, chunk.size() - 2);
+            // c_str: The default value is (or at least may be) NUL terminated.
+            theReturn << std::string((const char *)chunk.data()+2, chunk.size() - 2).c_str();
         break;
 
         case PalmLib::FlatFile::Field::BOOLEAN:
