diff options
author | Jim Meyering <jim@meyering.net> | 2002-01-22 10:44:13 +0000 |
---|---|---|
committer | Jim Meyering <jim@meyering.net> | 2002-01-22 10:44:13 +0000 |
commit | 437d89a15183a1b2ef66724360bd09a7ef7d9d71 (patch) | |
tree | 8a30cbfb40eb4d60adba74d24226132153024f8a /src | |
parent | 2b1c83e4e25e434d4e3ce42369ed8ca71b7d2978 (diff) | |
download | coreutils-437d89a15183a1b2ef66724360bd09a7ef7d9d71.tar.xz |
(skip): Use fseeko rather than lseek.
(Also, check for overflow when converting uintmax_t to off_t.)
Diffstat (limited to 'src')
-rw-r--r-- | src/od.c | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -1081,7 +1081,10 @@ skip (uintmax_t n_skip) n_skip -= file_stats.st_size; else { - if (lseek (fileno (in_stream), n_skip, SEEK_CUR) < 0) + off_t offset = n_skip; + if (offset == n_skip && 0 <= offset + ? fseeko (in_stream, offset, SEEK_CUR) != 0 + : (errno = EOVERFLOW, 1)) { error (0, errno, "%s", input_filename); err = 1; |