projects
/
platform
/
upstream
/
coreutils.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
2b1c83e
)
(skip): Use fseeko rather than lseek.
author
Jim Meyering
<jim@meyering.net>
Tue, 22 Jan 2002 10:44:13 +0000
(10:44 +0000)
committer
Jim Meyering
<jim@meyering.net>
Tue, 22 Jan 2002 10:44:13 +0000
(10:44 +0000)
(Also, check for overflow when converting uintmax_t to off_t.)
src/od.c
patch
|
blob
|
history
diff --git
a/src/od.c
b/src/od.c
index
ad73bb2
..
a08a7a5
100644
(file)
--- a/
src/od.c
+++ b/
src/od.c
@@
-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;