ports/mail/vmailmgr/files/patch-lib_vpwtable_gdbm__write.cc
Alexey Dokuchaev 7476b2680f - Unbreak fetching and building against contemporary compilers
- Allow to use GNU dbm for storage of virtual password tables
- Define LICENSE and install the usual set of documentation files
- Remove useless .if defined(PREFIX) check added back in r205864

Reported by:	pkg-fallout
2019-11-01 10:35:52 +00:00

33 lines
1,019 B
C++

--- 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;
}