Module Name: src Committed By: pooka Date: Fri Nov 19 15:40:56 UTC 2010
Modified Files: src/lib/librumpuser: sp_common.c Log Message: delint To generate a diff of this commit: cvs rdiff -u -r1.4 -r1.5 src/lib/librumpuser/sp_common.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/lib/librumpuser/sp_common.c diff -u src/lib/librumpuser/sp_common.c:1.4 src/lib/librumpuser/sp_common.c:1.5 --- src/lib/librumpuser/sp_common.c:1.4 Fri Nov 19 15:25:49 2010 +++ src/lib/librumpuser/sp_common.c Fri Nov 19 15:40:55 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: sp_common.c,v 1.4 2010/11/19 15:25:49 pooka Exp $ */ +/* $NetBSD: sp_common.c,v 1.5 2010/11/19 15:40:55 pooka Exp $ */ /* * Copyright (c) 2010 Antti Kantee. All Rights Reserved. @@ -469,10 +469,12 @@ return 0; } +/*ARGSUSED*/ static int unix_parse(const char *addr, struct sockaddr **sa, int allow_wildcard) { struct sockaddr_un sun; + size_t slen; if (strlen(addr) > sizeof(sun.sun_path)) return ENAMETOOLONG; @@ -484,12 +486,12 @@ memset(&sun, 0, sizeof(sun)); sun.sun_family = AF_LOCAL; strlcpy(sun.sun_path, addr, sizeof(sun.sun_path)); - sun.sun_len = SUN_LEN(&sun); + sun.sun_len = slen = SUN_LEN(&sun); - *sa = malloc(sun.sun_len); + *sa = malloc(slen); if (*sa == NULL) return errno; - memcpy(*sa, &sun, sun.sun_len); + memcpy(*sa, &sun, slen); return 0; }