Source-Changes-HG archive

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

[src/trunk]: src/games/factor revert previous and don't parse octal



details:   https://anonhg.NetBSD.org/src/rev/b14c730ab6f1
branches:  trunk
changeset: 944635:b14c730ab6f1
user:      christos <christos%NetBSD.org@localhost>
date:      Mon Oct 05 14:31:30 2020 +0000

description:
revert previous and don't parse octal

diffstat:

 games/factor/factor.c |  11 ++++-------
 1 files changed, 4 insertions(+), 7 deletions(-)

diffs (32 lines):

diff -r 17ec46eb85b1 -r b14c730ab6f1 games/factor/factor.c
--- a/games/factor/factor.c     Mon Oct 05 13:32:31 2020 +0000
+++ b/games/factor/factor.c     Mon Oct 05 14:31:30 2020 +0000
@@ -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 @@
 __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 @@
        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);
        }



Home | Main Index | Thread Index | Old Index