Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/lib/libc/stdlib Reorder memcpy(3) and save errno
details: https://anonhg.NetBSD.org/src/rev/971d787abcba
branches: trunk
changeset: 339353:971d787abcba
user: kamil <kamil%NetBSD.org@localhost>
date: Thu Jul 16 00:03:59 2015 +0000
description:
Reorder memcpy(3) and save errno
This change is for safety as memcpy(3) might change it.
Approved by <riastradh>
diffstat:
lib/libc/stdlib/reallocarr.c | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)
diffs (28 lines):
diff -r 8f9a3c789396 -r 971d787abcba lib/libc/stdlib/reallocarr.c
--- a/lib/libc/stdlib/reallocarr.c Wed Jul 15 19:08:43 2015 +0000
+++ b/lib/libc/stdlib/reallocarr.c Thu Jul 16 00:03:59 2015 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: reallocarr.c,v 1.1 2015/02/17 20:29:21 joerg Exp $ */
+/* $NetBSD: reallocarr.c,v 1.2 2015/07/16 00:03:59 kamil Exp $ */
/*-
* Copyright (c) 2015 Joerg Sonnenberger <joerg%NetBSD.org@localhost>.
@@ -30,7 +30,7 @@
*/
#include <sys/cdefs.h>
-__RCSID("$NetBSD: reallocarr.c,v 1.1 2015/02/17 20:29:21 joerg Exp $");
+__RCSID("$NetBSD: reallocarr.c,v 1.2 2015/07/16 00:03:59 kamil Exp $");
#include "namespace.h"
#include <errno.h>
@@ -55,8 +55,8 @@
void *optr;
void *nptr;
+ saved_errno = errno;
memcpy(&optr, ptr, sizeof(ptr));
- saved_errno = errno;
if (num == 0 || size == 0) {
free(optr);
nptr = NULL;
Home |
Main Index |
Thread Index |
Old Index