Fixed tmpnam(): name contained null-byte

This commit is contained in:
ceriel 1991-02-26 09:28:39 +00:00
parent 1118da779b
commit 9c0b85db41

View file

@ -19,7 +19,7 @@ tmpnam(char *s) {
name = name_buffer + strlen(name_buffer);
name = _i_compute(_getpid(), 10, name, 5);
*name++ = '.';
*name++ = '\0';
*name = '\0';
}
if (++count > TMP_MAX) count = 1; /* wrap-around */
*_i_compute(count, 10, name, 3) = '\0';