From: Dan McGee <dan-fd97jBR+K/6hPH1hqNUYSQ@public.gmane.org>
To: linux-nilfs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: [PATCH 5/7] Use strtoull instead of strtoul where applicable
Date: Wed, 21 Dec 2011 15:34:07 -0600 [thread overview]
Message-ID: <1324503249-17432-6-git-send-email-dan@archlinux.org> (raw)
In-Reply-To: <1324503249-17432-1-git-send-email-dan-fd97jBR+K/6hPH1hqNUYSQ@public.gmane.org>
When parsing into u64 or unsigned long long storage, we should use the
correct library function.
Signed-off-by: Dan McGee <dan-fd97jBR+K/6hPH1hqNUYSQ@public.gmane.org>
---
bin/dumpseg.c | 4 ++--
sbin/nilfs-clean/nilfs-clean.c | 2 +-
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/bin/dumpseg.c b/bin/dumpseg.c
index fbc587d..d6b4290 100644
--- a/bin/dumpseg.c
+++ b/bin/dumpseg.c
@@ -211,7 +211,7 @@ int main(int argc, char *argv[])
fprintf(stderr, "%s: too few arguments\n", progname);
exit(1);
} else {
- strtoul(argv[optind], &endptr, DUMPSEG_BASE);
+ strtoull(argv[optind], &endptr, DUMPSEG_BASE);
if (*endptr == '\0')
dev = NULL;
else
@@ -229,7 +229,7 @@ int main(int argc, char *argv[])
status = 0;
for (i = optind; i < argc; i++) {
- segnum = strtoul(argv[i], &endptr, DUMPSEG_BASE);
+ segnum = strtoull(argv[i], &endptr, DUMPSEG_BASE);
if (*endptr != '\0') {
fprintf(stderr, "%s: %s: invalid segment number\n",
progname, argv[i]);
diff --git a/sbin/nilfs-clean/nilfs-clean.c b/sbin/nilfs-clean/nilfs-clean.c
index 9d92b67..25aa14a 100644
--- a/sbin/nilfs-clean/nilfs-clean.c
+++ b/sbin/nilfs-clean/nilfs-clean.c
@@ -331,7 +331,7 @@ static int nilfs_clean_parse_protection_period(const char *arg)
char *endptr;
int ret = 0;
- period = strtoul(arg, &endptr, 10);
+ period = strtoull(arg, &endptr, 10);
if (endptr == arg) {
myprintf(_("Error: invalid protection period: %s\n"), arg);
ret = -1;
--
1.7.8
--
To unsubscribe from this list: send the line "unsubscribe linux-nilfs" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
next prev parent reply other threads:[~2011-12-21 21:34 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-12-21 21:34 [PATCH 0/7] A handful of small cleanups and improvements Dan McGee
[not found] ` <1324503249-17432-1-git-send-email-dan-fd97jBR+K/6hPH1hqNUYSQ@public.gmane.org>
2011-12-21 21:34 ` [PATCH 1/7] Add .gitignore rules for generated binaries Dan McGee
2011-12-21 21:34 ` [PATCH 2/7] umount.nilfs2 (libmount): send proper error code to complain function Dan McGee
2011-12-21 21:34 ` [PATCH 3/7] Remove kern_compat.h Dan McGee
[not found] ` <1324503249-17432-4-git-send-email-dan-fd97jBR+K/6hPH1hqNUYSQ@public.gmane.org>
2011-12-23 5:25 ` Ryusuke Konishi
2011-12-21 21:34 ` [PATCH 4/7] Alpha sort AC_CHECK_FUNCS list in configure.ac Dan McGee
2011-12-21 21:34 ` Dan McGee [this message]
2011-12-21 21:34 ` [PATCH 6/7] rmcp/chcp: sanity check for positive checkpoint number Dan McGee
2011-12-21 21:34 ` [PATCH 7/7] rmcp: print sensible error message on permission failure Dan McGee
[not found] ` <1324503249-17432-8-git-send-email-dan-fd97jBR+K/6hPH1hqNUYSQ@public.gmane.org>
2011-12-23 5:56 ` Ryusuke Konishi
[not found] ` <20111223.145629.123971064.ryusuke-sG5X7nlA6pw@public.gmane.org>
2011-12-23 15:00 ` Dan McGee
[not found] ` <CAEik5nNHs1Lp-Wz_p9k_Xt1-CBu4L=Agsf28vVC7iBp4mSsuwA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2011-12-24 7:20 ` Ryusuke Konishi
[not found] ` <20111224.162041.267403683.ryusuke-sG5X7nlA6pw@public.gmane.org>
2012-01-03 19:46 ` [PATCH] " Dan McGee
[not found] ` <1325619960-9715-1-git-send-email-dan-fd97jBR+K/6hPH1hqNUYSQ@public.gmane.org>
2012-01-05 5:14 ` Ryusuke Konishi
2011-12-22 16:35 ` [PATCH 0/7] A handful of small cleanups and improvements Ryusuke Konishi
[not found] ` <20111223.013541.163265429.ryusuke-sG5X7nlA6pw@public.gmane.org>
2011-12-23 6:40 ` Ryusuke Konishi
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=1324503249-17432-6-git-send-email-dan@archlinux.org \
--to=dan-fd97jbr+k/6hph1hqnuysq@public.gmane.org \
--cc=linux-nilfs-u79uwXL29TY76Z2rM5mHXA@public.gmane.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).