summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorchristos <christos@NetBSD.org>2020-10-05 14:31:30 +0000
committerchristos <christos@NetBSD.org>2020-10-05 14:31:30 +0000
commit63857264b04cacfc764c48e9ac97413d14f228ab (patch)
tree702331bc3619ce949007d47906f245689d4be2a1
parent86fc742d6e099e71b543e9da978c27fcf5cb6504 (diff)
downloadbsdgames-darwin-63857264b04cacfc764c48e9ac97413d14f228ab.tar.gz
bsdgames-darwin-63857264b04cacfc764c48e9ac97413d14f228ab.tar.zst
bsdgames-darwin-63857264b04cacfc764c48e9ac97413d14f228ab.zip
revert previous and don't parse octal
-rw-r--r--factor/factor.c11
1 files changed, 4 insertions, 7 deletions
diff --git a/factor/factor.c b/factor/factor.c
index c62f4005..7318393f 100644
--- a/factor/factor.c
+++ b/factor/factor.c
@@ -1,4 +1,4 @@
-/* $NetBSD: factor.c,v 1.32 2020/10/05 12:22:49 tnn Exp $ */
+/* $NetBSD: factor.c,v 1.33 2020/10/05 14:31:30 christos Exp $ */
/*
* Copyright (c) 1989, 1993
* The Regents of the University of California. All rights reserved.
@@ -41,7 +41,7 @@ __COPYRIGHT("@(#) Copyright (c) 1989, 1993\
__SCCSID("@(#)factor.c 8.4 (Berkeley) 5/4/95");
#endif
#ifdef __RCSID
-__RCSID("$NetBSD: factor.c,v 1.32 2020/10/05 12:22:49 tnn Exp $");
+__RCSID("$NetBSD: factor.c,v 1.33 2020/10/05 14:31:30 christos Exp $");
#endif
#ifdef __FBSDID
__FBSDID("$FreeBSD: head/usr.bin/factor/factor.c 356666 2020-01-12 20:25:11Z gad $");
@@ -423,11 +423,8 @@ convert_str2bn(BIGNUM **val, char *p)
if (*p == '+') p++;
if (*p == '-')
errx(1, "negative numbers aren't permitted.");
- if (*p == '0') {
- if (p[1] == 'x' || p[1] == 'X')
- n = BN_hex2bn(val, p + 2);
- else
- n = BN_oct2bn(val, p + 1);
+ if (*p == '0' && (p[1] == 'x' || p[1] == 'X')) {
+ n = BN_hex2bn(val, p + 2);
} else {
n = is_hex_str(p) ? BN_hex2bn(val, p) : BN_dec2bn(val, p);
}