has_chrootsafe(), call_set_ctxlimit(): removed
[util-vserver.git] / util-vserver / lib / getvservername.c
index 00dfd3a..0482537 100644 (file)
@@ -27,6 +27,7 @@
 #include <fcntl.h>
 #include <errno.h>
 #include <libgen.h>
+#include <unistd.h>
 
 static char *
 getRecentName(char *start, char *end)
@@ -46,6 +47,7 @@ getRecentName(char *start, char *end)
 
       if (TEMP_FAILURE_RETRY(read(fd, buf, len+1))==len) {
        while (len>0 && buf[len-1]=='\n') --len;
+       buf[len] = '\0';
        if (len>0) res = buf;
       }