Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sbin/ifconfig PR/50909: David Binderman: Optimize memset
details: https://anonhg.NetBSD.org/src/rev/8f9b66c80b52
branches: trunk
changeset: 343971:8f9b66c80b52
user: christos <christos%NetBSD.org@localhost>
date: Mon Mar 07 15:56:17 2016 +0000
description:
PR/50909: David Binderman: Optimize memset
diffstat:
sbin/ifconfig/env.c | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)
diffs (28 lines):
diff -r aa6010d37bf7 -r 8f9b66c80b52 sbin/ifconfig/env.c
--- a/sbin/ifconfig/env.c Mon Mar 07 15:55:06 2016 +0000
+++ b/sbin/ifconfig/env.c Mon Mar 07 15:56:17 2016 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: env.c,v 1.10 2016/03/07 12:48:53 christos Exp $ */
+/* $NetBSD: env.c,v 1.11 2016/03/07 15:56:17 christos Exp $ */
/*-
* Copyright (c) 2008 David Young. All rights reserved.
@@ -27,7 +27,7 @@
#include <sys/cdefs.h>
#ifndef lint
-__RCSID("$NetBSD: env.c,v 1.10 2016/03/07 12:48:53 christos Exp $");
+__RCSID("$NetBSD: env.c,v 1.11 2016/03/07 15:56:17 christos Exp $");
#endif /* not lint */
#include <errno.h>
@@ -141,8 +141,8 @@
errno = ENAMETOOLONG;
return -1;
}
- memset(buf, 0, buflen);
memcpy(buf, prop_data_data_nocopy(data), datalen);
+ memset(buf + datalen, 0, buflen - datalen);
return datalen;
}
Home |
Main Index |
Thread Index |
Old Index