* [PUSHED] gdb/python: replace strlen call with std::string::size call
@ 2023-03-03 10:10 Andrew Burgess
0 siblings, 0 replies; only message in thread
From: Andrew Burgess @ 2023-03-03 10:10 UTC (permalink / raw)
To: gdb-patches; +Cc: Andrew Burgess
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 | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/gdb/python/py-disasm.c b/gdb/python/py-disasm.c
index c3d8d8a7994..2dabec0013d 100644
--- 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 (),
base-commit: 67748abf53b22fd0273bb374923c101c9d597094
--
2.25.4
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2023-03-03 10:10 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-03-03 10:10 [PUSHED] gdb/python: replace strlen call with std::string::size call Andrew Burgess
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).