summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOtto Moerbeek <otto@cvs.openbsd.org>2017-12-17 08:21:11 +0000
committerOtto Moerbeek <otto@cvs.openbsd.org>2017-12-17 08:21:11 +0000
commit9fd85f2d70d7296ead7396975fbaedf9930a54bb (patch)
tree220d3a5dfb0abe28d6b39760698ee542388b73d4
parentfb4f6ef349de69cfbb03321cb7c90113c2a3b595 (diff)
Use proper BN functions for error reporting; from kshe
-rw-r--r--usr.bin/dc/mem.c16
1 files changed, 11 insertions, 5 deletions
diff --git a/usr.bin/dc/mem.c b/usr.bin/dc/mem.c
index db0abfe73e9..f954eeb51d2 100644
--- a/usr.bin/dc/mem.c
+++ b/usr.bin/dc/mem.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: mem.c,v 1.9 2017/12/12 19:08:57 otto Exp $ */
+/* $OpenBSD: mem.c,v 1.10 2017/12/17 08:21:10 otto Exp $ */
/*
* Copyright (c) 2003, Otto Moerbeek <otto@drijf.net>
@@ -91,13 +91,19 @@ bstrdup(const char *p)
void
bn_check(int x)
{
- if (x == 0)
- err(1, "big number failure %lx", ERR_get_error());
+ if (x == 0) {
+ ERR_load_BN_strings();
+ errx(1, "BN failure: %s",
+ ERR_reason_error_string(ERR_get_error()));
+ }
}
void
bn_checkp(const void *p)
{
- if (p == NULL)
- err(1, "allocation failure %lx", ERR_get_error());
+ if (p == NULL) {
+ ERR_load_BN_strings();
+ errx(1, "BN failure: %s",
+ ERR_reason_error_string(ERR_get_error()));
+ }
}