fixed cmd_bans expires time
[NeonServV5.git] / tools.c
diff --git a/tools.c b/tools.c
index fb74d5b0caf2bf4fd91a01560cc9ecdbc49311af..c42fb128115a0fc0972ceec74c32a0081e58e786 100644 (file)
--- a/tools.c
+++ b/tools.c
@@ -259,7 +259,7 @@ char* timeToStr(struct UserNode *user, int seconds, int items, char *buf) {
             }
             buf[p++] = ' ';
         }
-        buf[p-1] = '\0';
+        buf[(p ? p-1 : 0)] = '\0';
     }
     return buf;
 }