]> git.stg.codes - stg.git/blobdiff - projects/stargazer/plugins/configuration/sgconfig/rsconf.cpp
Minor echo fix
[stg.git] / projects / stargazer / plugins / configuration / sgconfig / rsconf.cpp
index 9ec72a1c1aa67f628c45e7af0dc72d9f1de23f37..c0b7b325ba8659123ea9f4d2224ef6bf9cc71029 100644 (file)
@@ -26,7 +26,7 @@
 *
 *******************************************************************/
 
-#include <unistd.h> // cloase, usleep
+#include <unistd.h> // close
 
 #include <cerrno>
 #include <csignal>
@@ -250,7 +250,7 @@ while (pos < stgHdrLen)
         return -1;
         }
     int ret = recv(sock, &buf[pos], stgHdrLen - pos, 0);
-    if (ret < 0)
+    if (ret <= 0)
         {
         state = confHdr;
         return -1;
@@ -310,7 +310,7 @@ while (pos < ADM_LOGIN_LEN) {
 
     int ret = recv(sock, &login[pos], ADM_LOGIN_LEN - pos, 0);
 
-    if (ret < 0)
+    if (ret <= 0)
         {
         // Error in network
         state = confHdr;
@@ -359,7 +359,7 @@ while (pos < ADM_LOGIN_LEN)
 
     int ret = recv(sock, &loginS[pos], ADM_LOGIN_LEN - pos, 0);
 
-    if (ret < 0)
+    if (ret <= 0)
         {
         // Network error
         printfd(__FILE__, "recv error: '%s'\n", strerror(errno));
@@ -461,7 +461,7 @@ while (1)
         }
 
     char buffer[8];
-    buffer[8] = 0;
+    buffer[7] = 0;
 
     DecodeString(buffer, bufferS, &ctx);
     requestList.push_back(std::string(buffer, pos));