]> sigrok.org Git - libsigrokdecode.git/commitdiff
mdio: accept MDIO READ without previous ADDRESS command
authorGerhard Sittig <redacted>
Wed, 1 Aug 2018 16:35:57 +0000 (18:35 +0200)
committerUwe Hermann <redacted>
Sat, 11 Aug 2018 20:58:45 +0000 (22:58 +0200)
Fix a Python string formatting issue, where the format string disagreed
with the argument list. A READ command could unexpectedly terminate the
decoder instance when there was no previous ADDRESS command.

This fixes bug #1258.

decoders/mdio/pd.py

index 9ea3a27349e372fbc0d5263c4c03b6a114658af2..25229129516c748548539b0775efa455af441a47 100644 (file)
@@ -95,7 +95,7 @@ class Decoder(srd.Decoder):
             if self.clause45 and self.clause45_addr != -1:
                 decoded_min += str.format('ADDR: %04X ' % self.clause45_addr)
             elif self.clause45:
             if self.clause45 and self.clause45_addr != -1:
                 decoded_min += str.format('ADDR: %04X ' % self.clause45_addr)
             elif self.clause45:
-                decoded_min += str.format('ADDR: UKWN ' % self.clause45_addr)
+                decoded_min += str.format('ADDR: UKWN ')
 
             if self.clause45 and self.opcode > 1 \
             or (not self.clause45 and self.opcode):
 
             if self.clause45 and self.opcode > 1 \
             or (not self.clause45 and self.opcode):