]> granicus.if.org Git - sudo/commitdiff
Cast off_t printed via printf(3) instead of assuming it is long long.
authorTodd C. Miller <Todd.Miller@courtesan.com>
Fri, 6 May 2016 20:17:32 +0000 (14:17 -0600)
committerTodd C. Miller <Todd.Miller@courtesan.com>
Fri, 6 May 2016 20:17:32 +0000 (14:17 -0600)
plugins/sudoers/timestamp.c

index cf0b3d4588ce936c44a8c5aee04b3c58307fbe37..f7a9ba09079574f4d2ca704b6ce6601f1894e4e6 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014-2015 Todd C. Miller <Todd.Miller@courtesan.com>
+ * Copyright (c) 2014-2016 Todd C. Miller <Todd.Miller@courtesan.com>
  *
  * Permission to use, copy, modify, and distribute this software for any
  * purpose with or without fee is hereby granted, provided that the above
@@ -127,8 +127,8 @@ ts_find_record(int fd, struct timestamp_entry *key, struct timestamp_entry *entr
                cur.size, sizeof(cur));
            if (lseek(fd, (off_t)cur.size - (off_t)sizeof(cur), SEEK_CUR) == -1) {
                sudo_debug_printf(SUDO_DEBUG_ERROR|SUDO_DEBUG_ERRNO|SUDO_DEBUG_LINENO,
-                   "unable to seek forward %lld",
-                   (off_t)cur.size - (off_t)sizeof(cur));
+                   "unable to seek forward %d",
+                   (int)cur.size - (int)sizeof(cur));
                break;
            }
            if (cur.size == 0)
@@ -290,7 +290,7 @@ ts_write(int fd, const char *fname, struct timestamp_entry *entry, off_t offset)
 #else
        if (lseek(fd, offset, SEEK_SET) == -1) {
            sudo_debug_printf(SUDO_DEBUG_ERROR|SUDO_DEBUG_ERRNO|SUDO_DEBUG_LINENO,
-               "unable to seek to %lld", offset);
+               "unable to seek to %lld", (long long)offset);
            nwritten = -1;
        } else {
            nwritten = write(fd, entry, entry->size);