Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/lib/libc/stdlib restore the previous form of the condition c...



details:   https://anonhg.NetBSD.org/src/rev/05197e527aac
branches:  trunk
changeset: 534648:05197e527aac
user:      jdolecek <jdolecek%NetBSD.org@localhost>
date:      Wed Jul 31 12:57:36 2002 +0000

description:
restore the previous form of the condition checking malloc() return value, which
was changed in previous revision

diffstat:

 lib/libc/stdlib/calloc.c |  9 ++++-----
 1 files changed, 4 insertions(+), 5 deletions(-)

diffs (29 lines):

diff -r 2b26ba85caea -r 05197e527aac lib/libc/stdlib/calloc.c
--- a/lib/libc/stdlib/calloc.c  Wed Jul 31 12:44:14 2002 +0000
+++ b/lib/libc/stdlib/calloc.c  Wed Jul 31 12:57:36 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: calloc.c,v 1.11 2002/07/31 09:26:49 itojun Exp $       */
+/*     $NetBSD: calloc.c,v 1.12 2002/07/31 12:57:36 jdolecek Exp $     */
 
 /*-
  * Copyright (c) 1990, 1993
@@ -38,7 +38,7 @@
 #if 0
 static char sccsid[] = "@(#)calloc.c   8.1 (Berkeley) 6/4/93";
 #else
-__RCSID("$NetBSD: calloc.c,v 1.11 2002/07/31 09:26:49 itojun Exp $");
+__RCSID("$NetBSD: calloc.c,v 1.12 2002/07/31 12:57:36 jdolecek Exp $");
 #endif
 #endif /* LIBC_SCCS and not lint */
 
@@ -59,8 +59,7 @@
                return NULL;
        }
        size *= num;
-       p = malloc(size);
-       if (p)
-               memset(p, 0, size);
+       if ((p = malloc(size)) != NULL)
+               memset(p, '\0', size);
        return(p);
 }



Home | Main Index | Thread Index | Old Index