public inbox for gdb-cvs@sourceware.org
help / color / mirror / Atom feed
From: Indu Bhagat <ibhagat@sourceware.org>
To: bfd-cvs@sourceware.org, gdb-cvs@sourceware.org
Subject: [binutils-gdb] libsframe: replace an strncat with strcat
Date: Fri, 13 Jan 2023 19:45:09 +0000 (GMT)	[thread overview]
Message-ID: <20230113194509.C6D013858C39@sourceware.org> (raw)

https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=68e0003e12184a9bc13e06d35b6bb168f5f27ed3

commit 68e0003e12184a9bc13e06d35b6bb168f5f27ed3
Author: Indu Bhagat <indu.bhagat@oracle.com>
Date:   Fri Jan 13 11:15:43 2023 -0800

    libsframe: replace an strncat with strcat
    
    Calling strncat with the size of the src string is not so meaningful.
    The length argument to strncat should specify the remaining bytes
    bytes in the destination; although in this case, it appears to be
    unncessary altogether to use strncat in the first place.
    
    libsframe/
            * sframe-dump.c (dump_sframe_func_with_fres): Use of strcat is
            just as fine.

Diff:
---
 libsframe/sframe-dump.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/libsframe/sframe-dump.c b/libsframe/sframe-dump.c
index 320555a0a51..5417a16f48c 100644
--- a/libsframe/sframe-dump.c
+++ b/libsframe/sframe-dump.c
@@ -176,8 +176,7 @@ dump_sframe_func_with_fres (sframe_decoder_ctx *sfd_ctx,
       const char *ra_mangled_p_str
 	= ((sframe_fre_get_ra_mangled_p (sfd_ctx, &fre, &err[2]))
 	   ? "[s]" : "   ");
-      size_t ra_mangled_p_str_size = strlen (ra_mangled_p_str);
-      strncat (temp, ra_mangled_p_str, ra_mangled_p_str_size);
+      strcat (temp, ra_mangled_p_str);
       printf ("%-13s", temp);
     }
 }

                 reply	other threads:[~2023-01-13 19:45 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=20230113194509.C6D013858C39@sourceware.org \
    --to=ibhagat@sourceware.org \
    --cc=bfd-cvs@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: link
Be 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).