terminate name with '\0'
authorEnrico Scholz <enrico.scholz@informatik.tu-chemnitz.de>
Mon, 3 Nov 2003 19:34:29 +0000 (19:34 +0000)
committerEnrico Scholz <enrico.scholz@informatik.tu-chemnitz.de>
Mon, 3 Nov 2003 19:34:29 +0000 (19:34 +0000)
git-svn-id: http://svn.linux-vserver.org/svn/util-vserver/trunk@347 94cd875c-1c1d-0410-91d2-eb244daf1a30

util-vserver/lib/getvservername.c

index 00dfd3a..0c212be 100644 (file)
@@ -46,6 +46,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;
       }