public inbox for gdb-cvs@sourceware.org help / color / mirror / Atom feed
From: Andrew Burgess <aburgess@sourceware.org> To: gdb-cvs@sourceware.org Subject: [binutils-gdb] gdb/python: replace strlen call with std::string::size call Date: Fri, 3 Mar 2023 10:09:51 +0000 (GMT) [thread overview] Message-ID: <20230303100951.CBE7B3858D37@sourceware.org> (raw) https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=6a208145d24c47912c8beb4f1f4b9abeb8d51134 commit 6a208145d24c47912c8beb4f1f4b9abeb8d51134 Author: Andrew Burgess <aburgess@redhat.com> Date: Mon Jan 23 15:21:05 2023 +0000 gdb/python: replace strlen call with std::string::size call 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. Diff: --- 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 (),
reply other threads:[~2023-03-03 10:09 UTC|newest] Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=20230303100951.CBE7B3858D37@sourceware.org \ --to=aburgess@sourceware.org \ --cc=gdb-cvs@sourceware.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
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).