Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/lib/librumpuser delint
details: https://anonhg.NetBSD.org/src/rev/c44dfd8fa675
branches: trunk
changeset: 758884:c44dfd8fa675
user: pooka <pooka%NetBSD.org@localhost>
date: Fri Nov 19 15:40:55 2010 +0000
description:
delint
diffstat:
lib/librumpuser/sp_common.c | 10 ++++++----
1 files changed, 6 insertions(+), 4 deletions(-)
diffs (38 lines):
diff -r 340bde01c01a -r c44dfd8fa675 lib/librumpuser/sp_common.c
--- a/lib/librumpuser/sp_common.c Fri Nov 19 15:25:49 2010 +0000
+++ b/lib/librumpuser/sp_common.c Fri Nov 19 15:40:55 2010 +0000
@@ -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;
}
Home |
Main Index |
Thread Index |
Old Index