Changed printf specifier for off_t

Fixes some warnings on OSX
This commit is contained in:
Nirgal Vourgère
2012-10-04 15:37:30 +02:00
parent 6b6e54bd14
commit 851877c86c
2 changed files with 4 additions and 2 deletions

View File

@@ -17,6 +17,7 @@
*/ */
#include "mdbtools.h" #include "mdbtools.h"
#include <inttypes.h>
#ifdef DMALLOC #ifdef DMALLOC
#include "dmalloc.h" #include "dmalloc.h"
@@ -364,7 +365,7 @@ static ssize_t _mdb_read_pg(MdbHandle *mdb, void *pg_buf, unsigned long pg)
fstat(mdb->f->fd, &status); fstat(mdb->f->fd, &status);
if (status.st_size < offset) { if (status.st_size < offset) {
fprintf(stderr,"offset %lu is beyond EOF\n",offset); fprintf(stderr,"offset %jd is beyond EOF\n",(intmax_t)offset);
return 0; return 0;
} }
if (mdb->stats && mdb->stats->collect) if (mdb->stats && mdb->stats->collect)

View File

@@ -19,6 +19,7 @@
#include "mdbtools.h" #include "mdbtools.h"
#include "time.h" #include "time.h"
#include "math.h" #include "math.h"
#include <inttypes.h>
#ifdef DMALLOC #ifdef DMALLOC
#include "dmalloc.h" #include "dmalloc.h"
@@ -80,7 +81,7 @@ mdb_write_pg(MdbHandle *mdb, unsigned long pg)
fstat(mdb->f->fd, &status); fstat(mdb->f->fd, &status);
/* is page beyond current size + 1 ? */ /* is page beyond current size + 1 ? */
if (status.st_size < offset + mdb->fmt->pg_size) { if (status.st_size < offset + mdb->fmt->pg_size) {
fprintf(stderr,"offset %lu is beyond EOF\n",offset); fprintf(stderr,"offset %jd is beyond EOF\n",(intmax_t)offset);
return 0; return 0;
} }
lseek(mdb->f->fd, offset, SEEK_SET); lseek(mdb->f->fd, offset, SEEK_SET);