diff options
Diffstat (limited to 'src/s')
| -rw-r--r-- | src/s/gnu-linux.h | 3 | ||||
| -rw-r--r-- | src/s/sol2-6.h | 3 | ||||
| -rw-r--r-- | src/s/unixware.h | 3 |
3 files changed, 3 insertions, 6 deletions
diff --git a/src/s/gnu-linux.h b/src/s/gnu-linux.h index e3d43249d81..6f45ee00b78 100644 --- a/src/s/gnu-linux.h +++ b/src/s/gnu-linux.h | |||
| @@ -63,8 +63,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */ | |||
| 63 | close (fd); \ | 63 | close (fd); \ |
| 64 | return -1; \ | 64 | return -1; \ |
| 65 | } \ | 65 | } \ |
| 66 | strncpy (pty_name, ptyname, sizeof (pty_name)); \ | 66 | snprintf (pty_name, sizeof pty_name, "%s", ptyname); \ |
| 67 | pty_name[sizeof (pty_name) - 1] = 0; \ | ||
| 68 | sigunblock (sigmask (SIGCHLD)); \ | 67 | sigunblock (sigmask (SIGCHLD)); \ |
| 69 | } | 68 | } |
| 70 | 69 | ||
diff --git a/src/s/sol2-6.h b/src/s/sol2-6.h index bb7a9859b7d..ec45748e03a 100644 --- a/src/s/sol2-6.h +++ b/src/s/sol2-6.h | |||
| @@ -54,8 +54,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */ | |||
| 54 | { emacs_close (fd); return -1; } \ | 54 | { emacs_close (fd); return -1; } \ |
| 55 | if (!(ptyname = ptsname (fd))) \ | 55 | if (!(ptyname = ptsname (fd))) \ |
| 56 | { emacs_close (fd); return -1; } \ | 56 | { emacs_close (fd); return -1; } \ |
| 57 | strncpy (pty_name, ptyname, sizeof (pty_name)); \ | 57 | snprintf (pty_name, sizeof pty_name, "%s", ptyname); \ |
| 58 | pty_name[sizeof (pty_name) - 1] = 0; \ | ||
| 59 | } | 58 | } |
| 60 | 59 | ||
| 61 | #define GC_SETJMP_WORKS 1 | 60 | #define GC_SETJMP_WORKS 1 |
diff --git a/src/s/unixware.h b/src/s/unixware.h index e9ebb63f30a..5bda987ffe1 100644 --- a/src/s/unixware.h +++ b/src/s/unixware.h | |||
| @@ -40,8 +40,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */ | |||
| 40 | fatal("could not unlock slave pty"); \ | 40 | fatal("could not unlock slave pty"); \ |
| 41 | if (!(ptyname = ptsname(fd))) \ | 41 | if (!(ptyname = ptsname(fd))) \ |
| 42 | fatal ("could not enable slave pty"); \ | 42 | fatal ("could not enable slave pty"); \ |
| 43 | strncpy(pty_name, ptyname, sizeof(pty_name)); \ | 43 | snprintf (pty_name, sizeof pty_name, "%s", ptyname); \ |
| 44 | pty_name[sizeof(pty_name) - 1] = 0; \ | ||
| 45 | } | 44 | } |
| 46 | 45 | ||
| 47 | /* Conservative garbage collection has not been tested, so for now | 46 | /* Conservative garbage collection has not been tested, so for now |