From 6f3b7f0f52fe880d92127350a3a415ec978905bb Mon Sep 17 00:00:00 2001 From: "Israel B. Sant'Anna" <ibsa14@inf.ufpr.br> Date: Sun, 6 Dec 2015 21:15:13 -0200 Subject: [PATCH] Fixed server ls Signed-off-by: Israel B. Sant'Anna <ibsa14@inf.ufpr.br> --- Protocol.cpp | 2 +- dirFunctions.cpp | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/Protocol.cpp b/Protocol.cpp index adf9982..66a35e1 100644 --- a/Protocol.cpp +++ b/Protocol.cpp @@ -69,7 +69,7 @@ int Protocol::setData(vector<BYTE> data, int type){ msg.data = subvector; if(size < MINSIZE){ BYTE zero = 0x00; - msg.data.insert(msg.data.begin(), MINSIZE-size, zero); + msg.data.insert(msg.data.end(), MINSIZE-size, zero); size = MINSIZE; } msg.size = bitset<SIZE_S>(size); diff --git a/dirFunctions.cpp b/dirFunctions.cpp index 0eed219..ec79426 100644 --- a/dirFunctions.cpp +++ b/dirFunctions.cpp @@ -16,6 +16,7 @@ void cd(string path){ string ls(string args){ string output; + args += " 2>&1"; FILE *lsOut = popen(args.c_str(), "r"); if(!lsOut){ throw "Couldn't execute ls"; -- GitLab