Skip to content

Commit

Permalink
Fix minor bug in read_address
Browse files Browse the repository at this point in the history
  • Loading branch information
korcankaraokcu committed Nov 29, 2018
1 parent 7245c35 commit c2fd165
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions libPINCE/gdb_python_scripts/ScriptUtils.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,11 +79,11 @@ def read_address(address, value_type, length=None, zero_terminate=True, only_byt
packed_data = type_defs.index_to_valuetype_dict.get(value_type, -1)
if type_defs.VALUE_INDEX.is_string(value_type):
try:
temp_len = int(length)
length = int(length)
except:
print(str(length) + " is not a valid length")
return
if not temp_len > 0:
if not length > 0:
print("length must be greater than 0")
return
expected_length = length * type_defs.string_index_to_multiplier_dict.get(value_type, 1)
Expand Down

0 comments on commit c2fd165

Please sign in to comment.