diff options
author | Gerardo Exequiel Pozzi <vmlinuz386@yahoo.com.ar> | 2009-03-09 13:58:44 -0700 |
---|---|---|
committer | Aaron Griffin <aaronmgriffin@gmail.com> | 2009-03-09 13:58:44 -0700 |
commit | 5d0fb0ef703ca78f399aadce43dd813effda52f5 (patch) | |
tree | d6dcd56d3e2aee6f1e9e2095281f54ff6c2c5ee1 | |
parent | f3a60b900d22349445de1481d6171297ac022ff0 (diff) |
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>
-rw-r--r-- | minilogd.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -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; |