diff options
| author | Joe Marcus Clarke <marcus@FreeBSD.org> | 2005-07-07 17:48:40 +0000 |
|---|---|---|
| committer | Joe Marcus Clarke <marcus@FreeBSD.org> | 2005-07-07 17:48:40 +0000 |
| commit | a617a18a2357cfe7a8fd0ec37820c168b3180582 (patch) | |
| tree | e6971802a667e9de8d82db62d2f08e6ce2a29f6c /lib/libc/stdlib | |
| parent | 2672e71736bc2f7d0e5d289320b486b646710342 (diff) | |
Notes
Diffstat (limited to 'lib/libc/stdlib')
| -rw-r--r-- | lib/libc/stdlib/grantpt.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/libc/stdlib/grantpt.c b/lib/libc/stdlib/grantpt.c index d0cb4ebe8b3f..a466cba0766a 100644 --- a/lib/libc/stdlib/grantpt.c +++ b/lib/libc/stdlib/grantpt.c @@ -223,9 +223,10 @@ ptsname(int fildes) if (!ISPTM(sbuf)) errno = EINVAL; else { - (void)sprintf(slave, _PATH_DEV PTS_PREFIX "%c%c", - PT_DEV1[minor(sbuf.st_rdev) / 32], - PT_DEV2[minor(sbuf.st_rdev) % 32]); + (void)snprintf(slave, sizeof(slave), + _PATH_DEV PTS_PREFIX "%s", + devname(sbuf.st_rdev, S_IFCHR) + + strlen(PTM_PREFIX)); retval = slave; } } |
