summaryrefslogtreecommitdiff
path: root/xhost.c
diff options
context:
space:
mode:
Diffstat (limited to 'xhost.c')
-rw-r--r--xhost.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/xhost.c b/xhost.c
index abbfcc1..6545fb7 100644
--- a/xhost.c
+++ b/xhost.c
@@ -765,8 +765,8 @@ get_hostname(XHostAddress *ha)
pwd = getpwuid(uid);
if (pwd)
- sprintf(netname, "%s@ (%*.*s)", pwd->pw_name,
- ha->length, ha->length, ha->address);
+ snprintf(netname, sizeof(netname), "%s@ (%*.*s)",
+ pwd->pw_name, ha->length, ha->length, ha->address);
}
#endif
return (netname);