tunneldiggercpp

git clone git://archive.git.mtrnord.blog/MTRNord/tunneldiggercpp.git
Log | Files | Refs | README

commit e232b37fea39d892487fd3b0c3e750853c1995f3
parent a248183ed901151ba317002d267f99ce7e519a78
Author: MTRNord <mtrnord1@gmail.com>
Date:   Fri, 22 Sep 2017 20:15:30 +0200

fix converting of strings

Signed-off-by: MTRNord <mtrnord1@gmail.com>

Diffstat:
Mbroker.cpp | 2+-
Mbroker.h | 4++--
Mmain.cpp | 4++--
3 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/broker.cpp b/broker.cpp @@ -13,7 +13,7 @@ using namespace std; - broker::TunnelManager::TunnelManager(char * nspaceL) { + broker::TunnelManager::TunnelManager(const char * nspaceL) { nspace = nspaceL; } diff --git a/broker.h b/broker.h @@ -10,11 +10,11 @@ class broker { public: class TunnelManager { public: - TunnelManager(char * nspaceL); + TunnelManager(const char * nspaceL); int initialize(); private: //Namespace is a taken var name in C++ so I use nspace isntead - char * nspace; + const char * nspace; }; }; diff --git a/main.cpp b/main.cpp @@ -33,9 +33,9 @@ int main(int argc, char* argv[]) { /* We might have elevated privileges beyond that of the user who invoked * the program, due to suid bit. Be very careful about trusting any data! */ - char * nspaceL = (char *) reader.Get("broker", "namespace", "l2tp"); + string nspaceL = (char *) reader.Get("broker", "namespace", "l2tp"); - broker::TunnelManager tunnelManager(nspaceL); + broker::TunnelManager tunnelManager(nspaceL.c_str()); tunnelManager.initialize(); } else { /* Anything goes. */