summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlan Coopersmith <alan.coopersmith@oracle.com>2024-01-24 17:42:19 -0800
committerAlan Coopersmith <alan.coopersmith@oracle.com>2024-01-24 17:42:19 -0800
commitb4b35189d54bef2c5d6062518076505167c3dd9b (patch)
tree46c2172f9de60c73839a6985b334d6b945cd16ef
parentc0ab2a2c42af6d2f34a987c7b9903e9737e27a87 (diff)
Modernize lseek() calls
Position should be stored in an off_t, not an int, and the "whence" arg should use symbolic constants instead of raw numbers. Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
-rw-r--r--src/fontfile/bufio.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/fontfile/bufio.c b/src/fontfile/bufio.c
index de06e1a..7465f72 100644
--- a/src/fontfile/bufio.c
+++ b/src/fontfile/bufio.c
@@ -83,9 +83,9 @@ BufFileRawFill (BufFilePtr f)
static int
BufFileRawSkip (BufFilePtr f, int count)
{
- int curoff;
- int fileoff;
- int todo;
+ off_t curoff;
+ off_t fileoff;
+ off_t todo;
curoff = f->bufp - f->buffer;
fileoff = curoff + f->left;
@@ -94,7 +94,7 @@ BufFileRawSkip (BufFilePtr f, int count)
f->left -= count;
} else {
todo = count - (fileoff - curoff);
- if (lseek (FileDes(f), todo, 1) == -1) {
+ if (lseek (FileDes(f), todo, SEEK_CUR) == -1) {
if (errno != ESPIPE)
return BUFFILEEOF;
while (todo) {