X-Git-Url: http://winboard.nl/cgi-bin?a=blobdiff_plain;f=childio.c;h=e0de2b61b0def8e31d031e9ddc1fa0525c6a27df;hb=0ea1b434ac6becf79c75d85ba27de5b89666a7c3;hp=1f99f82c512f9cc0e1be5b169af87a6e0767b2aa;hpb=01768d1677ff891d503bbfa250b09d373bfa7422;p=xboard.git diff --git a/childio.c b/childio.c index 1f99f82..e0de2b6 100644 --- a/childio.c +++ b/childio.c @@ -66,6 +66,7 @@ #include "common.h" #include "frontend.h" +#include "backend.h" /* for safeStrCpy */ #if !USE_PTYS /* This code is for systems where pipes work properly */ @@ -137,7 +138,7 @@ int PseudoTTY(pty_name) if (grantpt(fd) == -1) return -1; if (unlockpt(fd) == -1) return -1; if (!(ptss = ptsname(fd))) return -1; - strcpy(pty_name, ptss); + safeStrCpy(pty_name, ptss, sizeof(pty_name)/sizeof(pty_name[0])); return fd; } @@ -153,7 +154,7 @@ int PseudoTTY(pty_name) ptyn = _getpty(&fd, O_RDWR, 0600, 0); if (ptyn == NULL) return -1; - strcpy(pty_name, ptyn); + safeStrCpy(pty_name, ptyn, sizeof(pty_name)/sizeof(pty_name[0])); return fd; } @@ -169,7 +170,7 @@ int PseudoTTY(pty_name) fd = getpseudotty(&slave, &master); if (fd < 0) return fd; - strcpy(pty_name, slave); + safeStrCpy(pty_name, slave, sizeof(pty_name)/sizeof(pty_name[0])); return fd; }