diff options
Diffstat (limited to 'src/screen.c')
-rw-r--r-- | src/screen.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/screen.c b/src/screen.c index b0f70b4..3917b66 100644 --- a/src/screen.c +++ b/src/screen.c @@ -970,7 +970,7 @@ main(int argc, char **argv) Panic(0, "Cannot make directory '%s'.", SockDir); } if (SockDir != SockPath) - strcpy(SockPath, SockDir); + strncpy(SockPath, SockDir, MAXPATHLEN + 2 * MAXSTR); } #ifdef SOCKDIR else @@ -2591,7 +2591,7 @@ MakeWinMsgEv(char *str, struct win *win, int esc, int padlen, struct event *ev, *p = 0; if (win && (int)strlen(win->w_title) < l) { - strcpy(p, win->w_title); + strncpy(p, win->w_title, l); if (*p) qmflag = 1; } @@ -2628,7 +2628,7 @@ MakeWinMsgEv(char *str, struct win *win, int esc, int padlen, struct event *ev, *p = 0; if ((int)strlen(HostName) < l) { - strcpy(p, HostName); + strncpy(p, HostName, l); if (*p) qmflag = 1; } @@ -2641,7 +2641,7 @@ MakeWinMsgEv(char *str, struct win *win, int esc, int padlen, struct event *ev, session_name = strchr(SockName, '.') + 1; if ((int)strlen(session_name) < l) { - strcpy(p, session_name); + strncpy(p, session_name, l); if (*p) qmflag = 1; } |