]> granicus.if.org Git - sudo/commitdiff
Cast 2nd argument of lseek() to off_t if it is a constant for systems
authorTodd C. Miller <Todd.Miller@courtesan.com>
Tue, 7 Aug 2012 18:41:43 +0000 (14:41 -0400)
committerTodd C. Miller <Todd.Miller@courtesan.com>
Tue, 7 Aug 2012 18:41:43 +0000 (14:41 -0400)
with 64-bit off_t but without a proper lseek() prototype.

--HG--
branch : 1.7

iolog.c

diff --git a/iolog.c b/iolog.c
index 395e7106190f07768c89bf824d372f47fb14aa0c..f5845721a90ef5bcd49d4741f12ad005a84ab06d 100644 (file)
--- a/iolog.c
+++ b/iolog.c
@@ -146,7 +146,7 @@ io_nextid()
     sudo_user.sessid[6] = '\0';
 
     /* Rewind and overwrite old seq file. */
-    if (lseek(fd, 0, SEEK_SET) == (off_t)-1 || write(fd, buf, 7) != 7)
+    if (lseek(fd, (off_t)0, SEEK_SET) == (off_t)-1 || write(fd, buf, 7) != 7)
        log_fatal(USE_ERRNO, "Can't write to %s", pathbuf);
     close(fd);
 }