summaryrefslogtreecommitdiff
path: root/networking/fakeidentd.c
diff options
context:
space:
mode:
Diffstat (limited to 'networking/fakeidentd.c')
-rw-r--r--networking/fakeidentd.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/networking/fakeidentd.c b/networking/fakeidentd.c
index 18e86c5..0e543e7 100644
--- a/networking/fakeidentd.c
+++ b/networking/fakeidentd.c
@@ -110,13 +110,13 @@ static void handlexitsigs(int signum)
/* May succeed. If not, won't care. */
static void writepid(uid_t nobody, uid_t nogrp)
{
- char buf[24];
+ char buf[sizeof(int)*3 + 2];
int fd = open(PIDFILE, O_WRONLY|O_CREAT|O_TRUNC, 0664);
if (fd < 0)
return;
- snprintf(buf, 23, "%d\n", getpid());
+ sprintf(buf, "%d\n", getpid());
write(fd, buf, strlen(buf));
fchown(fd, nobody, nogrp);
close(fd);