diff options
Diffstat (limited to 'src/uniq.c')
-rw-r--r-- | src/uniq.c | 12 |
1 files changed, 6 insertions, 6 deletions
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'"), |