projects
/
binutils-gdb.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
67748ab
)
gdb/python: replace strlen call with std::string::size call
author
Andrew Burgess
<aburgess@redhat.com>
Mon, 23 Jan 2023 15:21:05 +0000
(15:21 +0000)
committer
Andrew Burgess
<aburgess@redhat.com>
Fri, 3 Mar 2023 09:56:21 +0000
(09:56 +0000)
Small cleanup to use std::string::size instead of calling strlen on
the result of std::string::c_str.
Should be no user visible changes after this call.
gdb/python/py-disasm.c
patch
|
blob
|
history
diff --git
a/gdb/python/py-disasm.c
b/gdb/python/py-disasm.c
index c3d8d8a79941e199ae6f4d3a385af9fcf16cc650..2dabec0013dcc8fe7dbb8ef987ba96e6b41f66b1 100644
(file)
--- a/
gdb/python/py-disasm.c
+++ b/
gdb/python/py-disasm.c
@@
-612,7
+612,7
@@
disasmpy_result_string (PyObject *self, void *closure)
disasm_result_object *obj = (disasm_result_object *) self;
gdb_assert (obj->content != nullptr);
- gdb_assert (
strlen (obj->content->c_str ()
) > 0);
+ gdb_assert (
obj->content->size (
) > 0);
gdb_assert (obj->length > 0);
return PyUnicode_Decode (obj->content->c_str (),
obj->content->size (),