Skip to content

Commit

Permalink
Changed printf specifier for off_t
Browse files Browse the repository at this point in the history
Fixes some warnings on OSX
  • Loading branch information
Nirgal Vourgère committed Oct 4, 2012
1 parent 6b6e54b commit 851877c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/libmdb/file.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
*/

#include "mdbtools.h"
#include <inttypes.h>

#ifdef DMALLOC
#include "dmalloc.h"
Expand Down Expand Up @@ -364,7 +365,7 @@ static ssize_t _mdb_read_pg(MdbHandle *mdb, void *pg_buf, unsigned long pg)

fstat(mdb->f->fd, &status);
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;
}
if (mdb->stats && mdb->stats->collect)
Expand Down
3 changes: 2 additions & 1 deletion src/libmdb/write.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
#include "mdbtools.h"
#include "time.h"
#include "math.h"
#include <inttypes.h>

#ifdef DMALLOC
#include "dmalloc.h"
Expand Down Expand Up @@ -80,7 +81,7 @@ mdb_write_pg(MdbHandle *mdb, unsigned long pg)
fstat(mdb->f->fd, &status);
/* is page beyond current size + 1 ? */
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;
}
lseek(mdb->f->fd, offset, SEEK_SET);
Expand Down

0 comments on commit 851877c

Please sign in to comment.