summaryrefslogtreecommitdiff
path: root/mail/vmailmgr/files/patch-lib_vpwtable_gdbm__write.cc
blob: f883e52f30dd22729398f564678a82e04667ddbc (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
--- lib/vpwtable/gdbm_write.cc.orig	2002-11-20 15:54:44 UTC
+++ lib/vpwtable/gdbm_write.cc
@@ -18,12 +18,13 @@
 #include <errno.h>
 #include "vpwtable.h"
 #include <gdbm.h>
+#include <unistd.h>
 
 class gdbm_vpwtable_writer : public vpwtable_writer
 {
 private:
-  const mystring& tmpname;
-  const mystring& destname;
+  const mystring tmpname;
+  const mystring destname;
   GDBM_FILE out;
   bool opened;
 public:
@@ -59,10 +60,10 @@ bool gdbm_vpwtable_writer::operator!() const
 
 bool gdbm_vpwtable_writer::put(const vpwentry& vpw)
 {
-  mystring name = vpw->name.lower();
-  datum key = { (char*)name.c_str(), name.length() };
-  mystring binary = vpw->to_record();
-  datum data = { (char*)binary.c_str(), binary.length() };
+  mystring name = vpw.name.lower();
+  datum key = { (char*)name.c_str(), static_cast<int>(name.length()) };
+  mystring binary = vpw.to_record();
+  datum data = { (char*)binary.c_str(), static_cast<int>(binary.length()) };
   return gdbm_store(out, key, data, GDBM_INSERT) == 0;
 }