Also: in the example EOVERFLOW is probably better than ENOMEM.

This commit is contained in:
jruoho 2010-04-30 07:16:35 +00:00
parent 67e69a6bf8
commit 42e4725801

View File

@ -1,4 +1,4 @@
.\" $NetBSD: malloc.3,v 1.32 2010/04/30 07:14:15 jruoho Exp $
.\" $NetBSD: malloc.3,v 1.33 2010/04/30 07:16:35 jruoho Exp $
.\"
.\" Copyright (c) 1980, 1991, 1993
.\" The Regents of the University of California. All rights reserved.
@ -96,7 +96,7 @@ If
must be used, be sure to test for overflow:
.Bd -literal -offset indent
if (size && number > SIZE_MAX / size) {
errno = ENOMEM;
errno = EOVERFLOW;
err(EXIT_FAILURE, "overflow");
}
.Ed