summaryrefslogtreecommitdiff
path: root/databases/palm-db-tools/patches/patch-ae
blob: 64bf8768166afc6548cd41eb32021f5ef743454f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
$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: