mirror of
https://github.com/mdbtools/mdbtools.git
synced 2025-09-20 19:27:53 +08:00
Changed printf specifier for off_t
Fixes some warnings on OSX
This commit is contained in:
@@ -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)
|
||||||
|
@@ -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);
|
||||||
|
Reference in New Issue
Block a user