summaryrefslogtreecommitdiff
path: root/xserver/os/access.c
diff options
context:
space:
mode:
Diffstat (limited to 'xserver/os/access.c')
-rw-r--r--xserver/os/access.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/xserver/os/access.c b/xserver/os/access.c
index cdb17589c..468ff2f64 100644
--- a/xserver/os/access.c
+++ b/xserver/os/access.c
@@ -1198,9 +1198,10 @@ ResetHosts (char *display)
strlen(display) + 1;
if (fnamelen > sizeof(fname))
FatalError("Display name `%s' is too long\n", display);
- sprintf(fname, ETC_HOST_PREFIX "%s" ETC_HOST_SUFFIX, display);
+ snprintf(fname, sizeof(fname), ETC_HOST_PREFIX "%s" ETC_HOST_SUFFIX,
+ display);
#ifdef __UNIXOS2__
- strcpy(fname, (char*)__XOS2RedirRoot(fname));
+ strlcpy(fname, (char*)__XOS2RedirRoot(fname), sizeof(fname));
#endif /* __UNIXOS2__ */
if ((fd = fopen (fname, "r")) != 0)