update for changed xstrtou?l
authorJim Meyering <jim@meyering.net>
Sat, 25 Jan 1997 06:21:24 +0000 (06:21 +0000)
committerJim Meyering <jim@meyering.net>
Sat, 25 Jan 1997 06:21:24 +0000 (06:21 +0000)
src/csplit.c
src/fold.c
src/head.c
src/join.c
src/nl.c
src/od.c
src/pr.c
src/uniq.c

index 8820c2b..ddd4311 100644 (file)
@@ -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;
index 64a5d39..b868102 100644 (file)
@@ -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);
index d21a31e..52aae62 100644 (file)
@@ -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
index debc5b3..d84f62d 100644 (file)
@@ -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;
index a52de48..62e5e2e 100644 (file)
--- 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.  */
 \f
 /* 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'"),
index ec87ccd..c3ad92b 100644 (file)
--- 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);
            }
index d28b410..9451d5e 100644 (file)
--- 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.  */
 \f
@@ -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,
index c40e822..237eb11 100644 (file)
@@ -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. */
 \f
@@ -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'"),