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/3f65a2c74264
branches: trunk
changeset: 343963:3f65a2c74264
user: christos <christos%NetBSD.org@localhost>
date: Mon Mar 07 12:48:53 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 00ea3986a652 -r 3f65a2c74264 sbin/ifconfig/env.c
--- a/sbin/ifconfig/env.c Mon Mar 07 10:52:17 2016 +0000
+++ b/sbin/ifconfig/env.c Mon Mar 07 12:48:53 2016 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: env.c,v 1.9 2013/02/07 13:20:51 apb Exp $ */
+/* $NetBSD: env.c,v 1.10 2016/03/07 12:48:53 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.9 2013/02/07 13:20:51 apb Exp $");
+__RCSID("$NetBSD: env.c,v 1.10 2016/03/07 12:48:53 christos Exp $");
#endif /* not lint */
#include <errno.h>
@@ -162,8 +162,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