From: Kurt Kanzenbach <kurt@linutronix.de>
To: Stephen Hemminger <stephen@networkplumber.org>
Cc: netdev@vger.kernel.org, Kurt Kanzenbach <kurt@linutronix.de>
Subject: [PATCH iproute2 1/1] utils: Fix get_s64() function
Date: Thu, 4 Jul 2019 14:24:27 +0200 [thread overview]
Message-ID: <20190704122427.22256-2-kurt@linutronix.de> (raw)
In-Reply-To: <20190704122427.22256-1-kurt@linutronix.de>
get_s64() uses internally strtoll() to parse the value out of a given
string. strtoll() returns a long long. However, the intermediate variable is
long only which might be 32 bit on some systems. So, fix it.
Signed-off-by: Kurt Kanzenbach <kurt@linutronix.de>
---
lib/utils.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lib/utils.c b/lib/utils.c
index be0f11b00280..9c3702fd4a04 100644
--- a/lib/utils.c
+++ b/lib/utils.c
@@ -390,7 +390,7 @@ int get_u8(__u8 *val, const char *arg, int base)
int get_s64(__s64 *val, const char *arg, int base)
{
- long res;
+ long long res;
char *ptr;
errno = 0;
--
2.11.0
next prev parent reply other threads:[~2019-07-04 12:25 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-07-04 12:24 [PATCH iproute2 0/1] Fix s64 argument parsing Kurt Kanzenbach
2019-07-04 12:24 ` Kurt Kanzenbach [this message]
2019-07-29 11:04 ` Kurt Kanzenbach
2019-07-29 15:51 ` Stephen Hemminger
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=20190704122427.22256-2-kurt@linutronix.de \
--to=kurt@linutronix.de \
--cc=netdev@vger.kernel.org \
--cc=stephen@networkplumber.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).