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;
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,
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)
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;
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. */
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);
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
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. */
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);
/* 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)
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,
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);
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;
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) */
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'"),
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);
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);
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'"),
}
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);
}
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
{
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);
{
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);
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,
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,
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);
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);
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,
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
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'"),
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'"),
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'"),
{
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'"),