]> git.ipfire.org Git - thirdparty/dnspython.git/commitdiff
In LOC, deal with 0 values for size, horizontal precision, and vertical precision.
authorBob Halley <halley@dnspython.org>
Mon, 3 Mar 2014 17:02:56 +0000 (09:02 -0800)
committerBob Halley <halley@dnspython.org>
Mon, 3 Mar 2014 17:02:56 +0000 (09:02 -0800)
dns/rdtypes/ANY/LOC.py

index 64b50c9b8888574c2843be99f3f0fabfba7c6a8c..55662e06f0b3995337fd19487b20186e923506df 100644 (file)
@@ -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: