public inbox for linux-man@vger.kernel.org
 help / color / mirror / Atom feed
From: Alejandro Colomar <colomar.6.4.3@gmail.com>
To: mtk.manpages@gmail.com
Cc: Alejandro Colomar <colomar.6.4.3@gmail.com>, linux-man@vger.kernel.org
Subject: [PATCH 2/3] strtol.3: EXAMPLES: As the default base, use special value 0
Date: Wed, 28 Oct 2020 10:33:07 +0100	[thread overview]
Message-ID: <20201028093308.86310-3-colomar.6.4.3@gmail.com> (raw)
In-Reply-To: <20201028093308.86310-1-colomar.6.4.3@gmail.com>

Signed-off-by: Alejandro Colomar <colomar.6.4.3@gmail.com>
---
 man3/strtol.3 | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/man3/strtol.3 b/man3/strtol.3
index 0feb12dbb..35252295e 100644
--- a/man3/strtol.3
+++ b/man3/strtol.3
@@ -266,7 +266,7 @@ main(int argc, char *argv[])
     }
 
     str = argv[1];
-    base = (argc > 2) ? atoi(argv[2]) : 10;
+    base = (argc > 2) ? atoi(argv[2]) : 0;
 
     errno = 0;    /* To distinguish success/failure after call */
     val = strtol(str, &endptr, base);
-- 
2.28.0


  parent reply	other threads:[~2020-10-28 23:23 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-28  9:33 [PATCH 0/3] Improve strtol(3) example Alejandro Colomar
2020-10-28  9:33 ` [PATCH 1/3] strtol.3: EXAMPLES: Delimit output string using "" Alejandro Colomar
2020-10-28  9:33 ` Alejandro Colomar [this message]
2020-10-28  9:33 ` [PATCH 3/3] strtol.3: EXAMPLES: Simplify errno checking (no expected change in behavior) Alejandro Colomar
2020-10-28 10:13 ` [PATCH 0/3] Improve strtol(3) example Michael Kerrisk (man-pages)

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=20201028093308.86310-3-colomar.6.4.3@gmail.com \
    --to=colomar.6.4.3@gmail.com \
    --cc=linux-man@vger.kernel.org \
    --cc=mtk.manpages@gmail.com \
    /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