summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBob Halley <halley@dnspython.org>2014-03-03 09:02:56 -0800
committerBob Halley <halley@dnspython.org>2014-03-03 09:02:56 -0800
commita4e1e13ac1dfe0f5a7c76183bb9964cb4441ccac (patch)
treef66c03c6ccfcc377fc659fd2cabbfed8095c62c8
parent5bb84b13364333fb4dabe1a9c9c7f464ceb20bf5 (diff)
downloaddnspython-a4e1e13ac1dfe0f5a7c76183bb9964cb4441ccac.tar.gz
In LOC, deal with 0 values for size, horizontal precision, and vertical precision.
-rw-r--r--dns/rdtypes/ANY/LOC.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/dns/rdtypes/ANY/LOC.py b/dns/rdtypes/ANY/LOC.py
index 64b50c9..55662e0 100644
--- a/dns/rdtypes/ANY/LOC.py
+++ b/dns/rdtypes/ANY/LOC.py
@@ -24,6 +24,8 @@ _pows = (1, 10, 100, 1000, 10000, 100000, 1000000, 10000000,
100000000, 1000000000, 10000000000)
def _exponent_of(what, desc):
+ if what == 0:
+ return 0
exp = None
for i in range(len(_pows)):
if what // _pows[i] == 0: