aboutsummaryrefslogtreecommitdiff
path: root/minilogd.c
diff options
context:
space:
mode:
authorGerardo Exequiel Pozzi <vmlinuz386@yahoo.com.ar>2009-03-09 13:58:44 -0700
committerAaron Griffin <aaronmgriffin@gmail.com>2009-03-09 13:58:44 -0700
commit5d0fb0ef703ca78f399aadce43dd813effda52f5 (patch)
treed6dcd56d3e2aee6f1e9e2095281f54ff6c2c5ee1 /minilogd.c
parentf3a60b900d22349445de1481d6171297ac022ff0 (diff)
downloadinitscripts-5d0fb0ef703ca78f399aadce43dd813effda52f5.tar.xz
minilogd: Initialize values for accept()
From the accept(2) manpage: The addrlen argument is a value-result argument: the caller must initialize it to contain the size (in bytes) of the structure pointed to by addr; on return it will contain the actual size of the peer address. Signed-off-by: Aaron Griffin <aaronmgriffin@gmail.com>
Diffstat (limited to 'minilogd.c')
-rw-r--r--minilogd.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/minilogd.c b/minilogd.c
index 743a585..32ca53e 100644
--- a/minilogd.c
+++ b/minilogd.c
@@ -78,8 +78,8 @@ void cleanup(int exitcode) {
void runDaemon(int sock) {
struct sockaddr_un addr;
int x,len,done=0;
- socklen_t addrlen;
- char *message;
+ socklen_t addrlen = sizeof(struct sockaddr_un);
+ char *message = NULL;
struct stat s1,s2;
struct pollfd pfds;