From: brilliantov@inbox.ru
To: git@vger.kernel.org
Cc: Brilliantov Kirill Vladimirovich <brilliantov@inbox.ru>
Subject: [PATCH] compat/inet_ntop.c: Use INET_ADDRSTRLEN and INET6_ADDRSTRLEN macroses
Date: Tue, 25 Aug 2015 13:34:39 +0300 [thread overview]
Message-ID: <1440498879-12382-1-git-send-email-brilliantov@inbox.ru> (raw)
From: Brilliantov Kirill Vladimirovich <brilliantov@inbox.ru>
Signed-off-by: Brilliantov Kirill Vladimirovich <brilliantov@inbox.ru>
---
compat/inet_ntop.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/compat/inet_ntop.c b/compat/inet_ntop.c
index 90b7cc4..fcd3b15 100644
--- a/compat/inet_ntop.c
+++ b/compat/inet_ntop.c
@@ -47,7 +47,7 @@ static const char *
inet_ntop4(const u_char *src, char *dst, size_t size)
{
static const char fmt[] = "%u.%u.%u.%u";
- char tmp[sizeof "255.255.255.255"];
+ char tmp[INET_ADDRSTRLEN];
int nprinted;
nprinted = snprintf(tmp, sizeof(tmp), fmt, src[0], src[1], src[2], src[3]);
@@ -78,7 +78,7 @@ inet_ntop6(const u_char *src, char *dst, size_t size)
* Keep this in mind if you think this function should have been coded
* to use pointer overlays. All the world's not a VAX.
*/
- char tmp[sizeof "ffff:ffff:ffff:ffff:ffff:ffff:255.255.255.255"], *tp;
+ char tmp[INET6_ADDRSTRLEN], *tp;
struct { int base, len; } best, cur;
unsigned int words[NS_IN6ADDRSZ / NS_INT16SZ];
int i;
--
2.1.4
next reply other threads:[~2015-08-25 11:14 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-08-25 10:34 brilliantov [this message]
2015-08-25 12:13 ` [PATCH] compat/inet_ntop.c: Use INET_ADDRSTRLEN and INET6_ADDRSTRLEN macroses Johannes Schindelin
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=1440498879-12382-1-git-send-email-brilliantov@inbox.ru \
--to=brilliantov@inbox.ru \
--cc=git@vger.kernel.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 NNTP newsgroup(s).