diff --git a/server/System.cpp b/server/System.cpp index 93fd90a6..c74c3699 100644 --- a/server/System.cpp +++ b/server/System.cpp @@ -260,7 +260,7 @@ string System::execute(const string &cmd) { } string ret; char buff[1024] = {0}; - while(fgets(buff, sizeof(buff), fPipe)){ + while(fgets(buff, sizeof(buff) - 1, fPipe)){ ret.append(buff); } pclose(fPipe);