summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/regress/lib/libc/db/dbtest.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/src/regress/lib/libc/db/dbtest.c b/src/regress/lib/libc/db/dbtest.c
index c28ec0db5e..f024891a56 100644
--- a/src/regress/lib/libc/db/dbtest.c
+++ b/src/regress/lib/libc/db/dbtest.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: dbtest.c,v 1.12 2009/10/27 23:59:32 deraadt Exp $ */ 1/* $OpenBSD: dbtest.c,v 1.13 2015/02/06 23:21:58 millert Exp $ */
2/* $NetBSD: dbtest.c,v 1.8 1996/05/03 21:57:48 cgd Exp $ */ 2/* $NetBSD: dbtest.c,v 1.8 1996/05/03 21:57:48 cgd Exp $ */
3 3
4/*- 4/*-
@@ -36,7 +36,7 @@
36#include <ctype.h> 36#include <ctype.h>
37#include <errno.h> 37#include <errno.h>
38#include <fcntl.h> 38#include <fcntl.h>
39#include <limits.h> 39#include <stdint.h>
40#include <stdio.h> 40#include <stdio.h>
41#include <stdlib.h> 41#include <stdlib.h>
42#include <string.h> 42#include <string.h>
@@ -685,10 +685,8 @@ rfile(name, lenp)
685 if ((fd = open(name, O_RDONLY, 0)) < 0 || 685 if ((fd = open(name, O_RDONLY, 0)) < 0 ||
686 fstat(fd, &sb)) 686 fstat(fd, &sb))
687 dberr("%s: %s\n", name, strerror(errno)); 687 dberr("%s: %s\n", name, strerror(errno));
688#ifdef NOT_PORTABLE 688 if (sb.st_size > (off_t)SIZE_MAX)
689 if (sb.st_size > (off_t)SIZE_T_MAX)
690 dberr("%s: %s\n", name, strerror(E2BIG)); 689 dberr("%s: %s\n", name, strerror(E2BIG));
691#endif
692 if ((p = (void *)malloc((u_int)sb.st_size)) == NULL) 690 if ((p = (void *)malloc((u_int)sb.st_size)) == NULL)
693 dberr("%s", strerror(errno)); 691 dberr("%s", strerror(errno));
694 (void)read(fd, p, (int)sb.st_size); 692 (void)read(fd, p, (int)sb.st_size);