summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJim Meyering <jim@meyering.net>1997-01-25 06:21:24 +0000
committerJim Meyering <jim@meyering.net>1997-01-25 06:21:24 +0000
commita8bcd782c456fb67229a2271a083cbadfa1bed79 (patch)
tree2763e0649ac7cce6579abece692a039753a6160d /src
parent2be7ff8311c5497b15fcf60aeaca7df1c4313338 (diff)
downloadcoreutils-a8bcd782c456fb67229a2271a083cbadfa1bed79.tar.xz
update for changed xstrtou?l
Diffstat (limited to 'src')
-rw-r--r--src/csplit.c8
-rw-r--r--src/fold.c6
-rw-r--r--src/head.c4
-rw-r--r--src/join.c14
-rw-r--r--src/nl.c12
-rw-r--r--src/od.c2
-rw-r--r--src/pr.c18
-rw-r--r--src/uniq.c12
8 files changed, 38 insertions, 38 deletions
diff --git a/src/csplit.c b/src/csplit.c
index 8820c2bce..ddd4311c3 100644
--- a/src/csplit.c
+++ b/src/csplit.c
@@ -1129,7 +1129,7 @@ check_for_offset (struct control *p, const char *str, const char *num)
if (*num != '-' && *num != '+')
error (EXIT_FAILURE, 0, _("%s: `+' or `-' expected after delimeter"), str);
- if (xstrtoul (num + 1, NULL, 10, &val, NULL) != LONGINT_OK
+ if (xstrtoul (num + 1, NULL, 10, &val, "") != LONGINT_OK
|| val > UINT_MAX)
error (EXIT_FAILURE, 0, _("%s: integer expected after `%c'"), str, *num);
p->offset = (unsigned int) val;
@@ -1158,7 +1158,7 @@ parse_repeat_count (int argnum, struct control *p, char *str)
p->repeat_forever = 1;
else
{
- if (xstrtoul (str + 1, NULL, 10, &val, NULL) != LONGINT_OK
+ if (xstrtoul (str + 1, NULL, 10, &val, "") != LONGINT_OK
|| val > UINT_MAX)
{
error (EXIT_FAILURE, 0,
@@ -1240,7 +1240,7 @@ parse_patterns (int argc, int start, char **argv)
p = new_control_record ();
p->argnum = i;
- if (xstrtoul (argv[i], NULL, 10, &val, NULL) != LONGINT_OK
+ if (xstrtoul (argv[i], NULL, 10, &val, "") != LONGINT_OK
|| val > INT_MAX)
error (EXIT_FAILURE, 0, _("%s: invalid pattern"), argv[i]);
if (val == 0)
@@ -1496,7 +1496,7 @@ main (int argc, char **argv)
break;
case 'n':
- if (xstrtoul (optarg, NULL, 10, &val, NULL) != LONGINT_OK
+ if (xstrtoul (optarg, NULL, 10, &val, "") != LONGINT_OK
|| val > INT_MAX)
error (EXIT_FAILURE, 0, _("%s: invalid number"), optarg);
digits = (int) val;
diff --git a/src/fold.c b/src/fold.c
index 64a5d393a..b86810285 100644
--- a/src/fold.c
+++ b/src/fold.c
@@ -12,8 +12,8 @@
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+ along with this program; if not, write to the Free Software Foundation,
+ Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
/* Written by David MacKenzie, djm@gnu.ai.mit.edu. */
@@ -295,7 +295,7 @@ main (int argc, char **argv)
case 'w': /* Line width. */
{
long int tmp_long;
- if (xstrtol (optarg, NULL, 10, &tmp_long, NULL) != LONGINT_OK
+ if (xstrtol (optarg, NULL, 10, &tmp_long, "") != LONGINT_OK
|| tmp_long <= 0 || tmp_long > INT_MAX)
error (EXIT_FAILURE, 0,
_("invalid number of columns: `%s'"), optarg);
diff --git a/src/head.c b/src/head.c
index d21a31e47..52aae62a0 100644
--- a/src/head.c
+++ b/src/head.c
@@ -12,8 +12,8 @@
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+ along with this program; if not, write to the Free Software Foundation,
+ Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
/* Options: (see usage)
Reads from standard input if no files are given or when a filename of
diff --git a/src/join.c b/src/join.c
index debc5b3c7..d84f62d39 100644
--- a/src/join.c
+++ b/src/join.c
@@ -12,8 +12,8 @@
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ along with this program; if not, write to the Free Software Foundation,
+ Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
Written by Mike Haertel, mike@gnu.ai.mit.edu. */
@@ -678,7 +678,7 @@ decode_field_spec (const char *s, int *file_index, int *field_index)
strtol_error s_err;
long int tmp_long;
- s_err = xstrtol (s + 2, NULL, 10, &tmp_long, NULL);
+ s_err = xstrtol (s + 2, NULL, 10, &tmp_long, "");
if (s_err != LONGINT_OK || tmp_long <= 0 || tmp_long > INT_MAX)
{
error (0, 0, _("invalid field number: `%s'"), s + 2);
@@ -787,7 +787,7 @@ main (int argc, char **argv)
/* Fall through. */
case 'a':
- if (xstrtol (optarg, NULL, 10, &val, NULL) != LONGINT_OK
+ if (xstrtol (optarg, NULL, 10, &val, "") != LONGINT_OK
|| (val != 1 && val != 2))
error (EXIT_FAILURE, 0, _("invalid field number: `%s'"), optarg);
if (val == 1)
@@ -805,7 +805,7 @@ main (int argc, char **argv)
break;
case '1':
- if (xstrtol (optarg, NULL, 10, &val, NULL) != LONGINT_OK
+ if (xstrtol (optarg, NULL, 10, &val, "") != LONGINT_OK
|| val <= 0 || val > INT_MAX)
{
error (EXIT_FAILURE, 0,
@@ -815,7 +815,7 @@ main (int argc, char **argv)
break;
case '2':
- if (xstrtol (optarg, NULL, 10, &val, NULL) != LONGINT_OK
+ if (xstrtol (optarg, NULL, 10, &val, "") != LONGINT_OK
|| val <= 0 || val > INT_MAX)
error (EXIT_FAILURE, 0,
_("invalid field number for file 2: `%s'"), optarg);
@@ -823,7 +823,7 @@ main (int argc, char **argv)
break;
case 'j':
- if (xstrtol (optarg, NULL, 10, &val, NULL) != LONGINT_OK
+ if (xstrtol (optarg, NULL, 10, &val, "") != LONGINT_OK
|| val <= 0 || val > INT_MAX)
error (EXIT_FAILURE, 0, _("invalid field number: `%s'"), optarg);
join_field_1 = join_field_2 = (int) val - 1;
diff --git a/src/nl.c b/src/nl.c
index a52de4819..62e5e2ebf 100644
--- a/src/nl.c
+++ b/src/nl.c
@@ -12,8 +12,8 @@
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+ along with this program; if not, write to the Free Software Foundation,
+ Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
/* Written by Scott Bartram (nancy!scott@uunet.uu.net)
Revised by David MacKenzie (djm@gnu.ai.mit.edu) */
@@ -495,7 +495,7 @@ main (int argc, char **argv)
case 'v':
{
long int tmp_long;
- if (xstrtol (optarg, NULL, 10, &tmp_long, NULL) != LONGINT_OK
+ if (xstrtol (optarg, NULL, 10, &tmp_long, "") != LONGINT_OK
/* Allow it to be negative. */
|| tmp_long > INT_MAX)
error (EXIT_FAILURE, 0, _("invalid starting line number: `%s'"),
@@ -506,7 +506,7 @@ main (int argc, char **argv)
case 'i':
{
long int tmp_long;
- if (xstrtol (optarg, NULL, 10, &tmp_long, NULL) != LONGINT_OK
+ if (xstrtol (optarg, NULL, 10, &tmp_long, "") != LONGINT_OK
|| tmp_long <= 0 || tmp_long > INT_MAX)
error (EXIT_FAILURE, 0, _("invalid line number increment: `%s'"),
optarg);
@@ -519,7 +519,7 @@ main (int argc, char **argv)
case 'l':
{
long int tmp_long;
- if (xstrtol (optarg, NULL, 10, &tmp_long, NULL) != LONGINT_OK
+ if (xstrtol (optarg, NULL, 10, &tmp_long, "") != LONGINT_OK
|| tmp_long <= 0 || tmp_long > INT_MAX)
error (EXIT_FAILURE, 0, _("invalid number of blank lines: `%s'"),
optarg);
@@ -532,7 +532,7 @@ main (int argc, char **argv)
case 'w':
{
long int tmp_long;
- if (xstrtol (optarg, NULL, 10, &tmp_long, NULL) != LONGINT_OK
+ if (xstrtol (optarg, NULL, 10, &tmp_long, "") != LONGINT_OK
|| tmp_long <= 0 || tmp_long > INT_MAX)
error (EXIT_FAILURE, 0,
_("invalid line number field width: `%s'"),
diff --git a/src/od.c b/src/od.c
index ec87ccd4e..c3ad92b97 100644
--- a/src/od.c
+++ b/src/od.c
@@ -1776,7 +1776,7 @@ the maximum\nrepresentable value of type `long'"), optarg);
}
else
{
- s_err = xstrtoul (optarg, NULL, 10, &desired_width, NULL);
+ s_err = xstrtoul (optarg, NULL, 10, &desired_width, "");
if (s_err != LONGINT_OK)
STRTOL_FATAL_ERROR (optarg, _("width specification"), s_err);
}
diff --git a/src/pr.c b/src/pr.c
index d28b41005..9451d5e24 100644
--- a/src/pr.c
+++ b/src/pr.c
@@ -12,8 +12,8 @@
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+ along with this program; if not, write to the Free Software Foundation,
+ Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
/* Author: Pete TerMaat. */
@@ -634,7 +634,7 @@ first_last_page (char *pages)
{
long int tmp_long;
- if (xstrtol (pages, NULL, 10, &tmp_long, NULL) != LONGINT_OK
+ if (xstrtol (pages, NULL, 10, &tmp_long, "") != LONGINT_OK
|| tmp_long <= 0 || tmp_long > INT_MAX)
error (EXIT_FAILURE, 0, _("invalid starting page number: `%s'"),
pages);
@@ -646,7 +646,7 @@ first_last_page (char *pages)
{
long int tmp_long;
- if (xstrtol (str1 + 1, NULL, 10, &tmp_long, NULL) != LONGINT_OK
+ if (xstrtol (str1 + 1, NULL, 10, &tmp_long, "") != LONGINT_OK
|| tmp_long <= 0 || tmp_long > INT_MAX)
error (EXIT_FAILURE, 0, _("invalid ending page number: `%s'"),
str1 + 1);
@@ -775,7 +775,7 @@ main (int argc, char **argv)
case 'l':
{
long int tmp_long;
- if (xstrtol (optarg, NULL, 10, &tmp_long, NULL) != LONGINT_OK
+ if (xstrtol (optarg, NULL, 10, &tmp_long, "") != LONGINT_OK
|| tmp_long <= 0 || tmp_long > INT_MAX)
{
error (EXIT_FAILURE, 0,
@@ -799,7 +799,7 @@ main (int argc, char **argv)
skip_count = FALSE;
{
long int tmp_long;
- if (xstrtol (optarg, NULL, 10, &tmp_long, NULL) != LONGINT_OK
+ if (xstrtol (optarg, NULL, 10, &tmp_long, "") != LONGINT_OK
|| tmp_long > INT_MAX)
{
error (EXIT_FAILURE, 0,
@@ -812,7 +812,7 @@ main (int argc, char **argv)
case 'o':
{
long int tmp_long;
- if (xstrtol (optarg, NULL, 10, &tmp_long, NULL) != LONGINT_OK
+ if (xstrtol (optarg, NULL, 10, &tmp_long, "") != LONGINT_OK
|| tmp_long <= 0 || tmp_long > INT_MAX)
error (EXIT_FAILURE, 0,
_("`-o MARGIN' invalid line offset: `%s'"), optarg);
@@ -842,7 +842,7 @@ main (int argc, char **argv)
truncate_lines = TRUE;
{
long int tmp_long;
- if (xstrtol (optarg, NULL, 10, &tmp_long, NULL) != LONGINT_OK
+ if (xstrtol (optarg, NULL, 10, &tmp_long, "") != LONGINT_OK
|| tmp_long <= 0 || tmp_long > INT_MAX)
error (EXIT_FAILURE, 0,
_("`-w PAGE_WIDTH' invalid column number: `%s'"), optarg);
@@ -919,7 +919,7 @@ getoptarg (char *arg, char switch_char, char *character, int *number)
if (*arg)
{
long int tmp_long;
- if (xstrtol (arg, NULL, 10, &tmp_long, NULL) != LONGINT_OK
+ if (xstrtol (arg, NULL, 10, &tmp_long, "") != LONGINT_OK
|| tmp_long <= 0 || tmp_long > INT_MAX)
{
error (0, 0,
diff --git a/src/uniq.c b/src/uniq.c
index c40e822f8..237eb1124 100644
--- a/src/uniq.c
+++ b/src/uniq.c
@@ -12,8 +12,8 @@
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+ along with this program; if not, write to the Free Software Foundation,
+ Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
/* Written by Richard Stallman and David MacKenzie. */
@@ -336,7 +336,7 @@ main (int argc, char **argv)
case 'f': /* Like '-#'. */
{
long int tmp_long;
- if (xstrtol (optarg, NULL, 10, &tmp_long, NULL) != LONGINT_OK
+ if (xstrtol (optarg, NULL, 10, &tmp_long, "") != LONGINT_OK
|| tmp_long <= 0 || tmp_long > INT_MAX)
error (EXIT_FAILURE, 0,
_("invalid number of fields to skip: `%s'"),
@@ -352,7 +352,7 @@ main (int argc, char **argv)
case 's': /* Like '+#'. */
{
long int tmp_long;
- if (xstrtol (optarg, NULL, 10, &tmp_long, NULL) != LONGINT_OK
+ if (xstrtol (optarg, NULL, 10, &tmp_long, "") != LONGINT_OK
|| tmp_long <= 0 || tmp_long > INT_MAX)
error (EXIT_FAILURE, 0,
_("invalid number of bytes to skip: `%s'"),
@@ -368,7 +368,7 @@ main (int argc, char **argv)
case 'w':
{
long int tmp_long;
- if (xstrtol (optarg, NULL, 10, &tmp_long, NULL) != LONGINT_OK
+ if (xstrtol (optarg, NULL, 10, &tmp_long, "") != LONGINT_OK
|| tmp_long <= 0 || tmp_long > INT_MAX)
error (EXIT_FAILURE, 0,
_("invalid number of bytes to compare: `%s'"),
@@ -399,7 +399,7 @@ main (int argc, char **argv)
{
char *opt_str = argv[optind++];
long int tmp_long;
- if (xstrtol (opt_str, NULL, 10, &tmp_long, NULL) != LONGINT_OK
+ if (xstrtol (opt_str, NULL, 10, &tmp_long, "") != LONGINT_OK
|| tmp_long <= 0 || tmp_long > INT_MAX)
error (EXIT_FAILURE, 0,
_("invalid number of bytes to compare: `%s'"),