summaryrefslogtreecommitdiffstats
path: root/pbn_init.c
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@zytor.com>2007-10-12 11:12:28 -0700
committerH. Peter Anvin <hpa@zytor.com>2007-10-12 11:12:28 -0700
commit32367802a06117aa8c30762ea4e24b449891b3d0 (patch)
treeeea0ac0c93cb2e4cf64bbf54e189ef1497e6b70e /pbn_init.c
parented6d3879f55e8ebf6d0f58c15d62befe848d84e5 (diff)
downloadpbn-32367802a06117aa8c30762ea4e24b449891b3d0.tar.gz
pbn-32367802a06117aa8c30762ea4e24b449891b3d0.tar.xz
pbn-32367802a06117aa8c30762ea4e24b449891b3d0.zip
Be more careful about the zero case
Handle the zero case better
Diffstat (limited to 'pbn_init.c')
-rw-r--r--pbn_init.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/pbn_init.c b/pbn_init.c
index 53edb87..a6ce544 100644
--- a/pbn_init.c
+++ b/pbn_init.c
@@ -83,7 +83,10 @@ struct pbn *pbn_int(pbn_satom_t v)
if (!pbn)
return NULL;
- if (v < 0) {
+ if (v == 0) {
+ /* pbn->num[0] = pbn->bits = pbn->minus = 0; */
+ return pbn;
+ } else if (v < 0) {
v = -v;
pbn->minus = 1;
} else {