public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
From: Gaius Mulley <gaius@gcc.gnu.org>
To: gcc-cvs@gcc.gnu.org
Subject: [gcc r13-6359] libgm2/libm2pim/sckt.cc:254:3: warning: memset() called to fill 0 bytes [PR108944]
Date: Mon, 27 Feb 2023 16:30:03 +0000 (GMT)	[thread overview]
Message-ID: <20230227163003.6BBD73858D32@sourceware.org> (raw)

https://gcc.gnu.org/g:e5fcf084e381aefe170dcd418dc97e469dacfa91

commit r13-6359-ge5fcf084e381aefe170dcd418dc97e469dacfa91
Author: Gaius Mulley <gaiusmod2@gmail.com>
Date:   Mon Feb 27 16:29:18 2023 +0000

    libgm2/libm2pim/sckt.cc:254:3: warning: memset() called to fill 0 bytes [PR108944]
    
    The pattern parameter to memset is second.  Correct an obvious mistake
    in libm2pim/sckt.cc.
    
    libgm2/ChangeLog:
    
            PR modula2/108944
            * libm2pim/sckt.cc (getLocalIP): Correct parameter order.
    
    Signed-off-by: Gaius Mulley <gaiusmod2@gmail.com>

Diff:
---
 libgm2/libm2pim/sckt.cc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libgm2/libm2pim/sckt.cc b/libgm2/libm2pim/sckt.cc
index ee579c2cc69..cd9d9c558b2 100644
--- a/libgm2/libm2pim/sckt.cc
+++ b/libgm2/libm2pim/sckt.cc
@@ -251,7 +251,7 @@ EXPORT(getLocalIP) (tcpServerState *s)
       return 0;
     }
 
-  memset (&sa, sizeof (struct sockaddr_in), 0);
+  memset (&sa, 0, sizeof (struct sockaddr_in));
   sa.sin_family = AF_INET;
   sa.sin_port = htons (80);
   if (hp->h_length == sizeof (unsigned int))

                 reply	other threads:[~2023-02-27 16:30 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=20230227163003.6BBD73858D32@sourceware.org \
    --to=gaius@gcc.gnu.org \
    --cc=gcc-cvs@gcc.gnu.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).