From c2fd165801bb79e81f66a3c140209023e5551c56 Mon Sep 17 00:00:00 2001 From: korcankaraokcu Date: Thu, 29 Nov 2018 20:25:58 +0300 Subject: [PATCH] Fix minor bug in read_address --- libPINCE/gdb_python_scripts/ScriptUtils.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libPINCE/gdb_python_scripts/ScriptUtils.py b/libPINCE/gdb_python_scripts/ScriptUtils.py index 1850ce70..aa41e84f 100644 --- a/libPINCE/gdb_python_scripts/ScriptUtils.py +++ b/libPINCE/gdb_python_scripts/ScriptUtils.py @@ -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)