summaryrefslogtreecommitdiff
path: root/source4/lib/tdb/common/io.c
diff options
context:
space:
mode:
Diffstat (limited to 'source4/lib/tdb/common/io.c')
-rw-r--r--source4/lib/tdb/common/io.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/source4/lib/tdb/common/io.c b/source4/lib/tdb/common/io.c
index b3d1c56dc4..cd06dbb1e3 100644
--- a/source4/lib/tdb/common/io.c
+++ b/source4/lib/tdb/common/io.c
@@ -124,8 +124,10 @@ static int tdb_read(struct tdb_context *tdb, tdb_off_t off, void *buf,
if (ret != (ssize_t)len) {
/* Ensure ecode is set for log fn. */
tdb->ecode = TDB_ERR_IO;
- TDB_LOG((tdb, TDB_DEBUG_FATAL,"tdb_read failed at %d len=%d ret=%d (%s) map_size=%d\n",
- off, len, ret, strerror(errno), (int)tdb->map_size));
+ TDB_LOG((tdb, TDB_DEBUG_FATAL,"tdb_read failed at %d "
+ "len=%d ret=%d (%s) map_size=%d\n",
+ (int)off, (int)len, (int)ret, strerror(errno),
+ (int)tdb->map_size));
return TDB_ERRCODE(TDB_ERR_IO, -1);
}
}
@@ -339,7 +341,7 @@ unsigned char *tdb_alloc_read(struct tdb_context *tdb, tdb_off_t offset, tdb_len
len = 1;
}
- if (!(buf = malloc(len))) {
+ if (!(buf = (unsigned char *)malloc(len))) {
/* Ensure ecode is set for log fn. */
tdb->ecode = TDB_ERR_OOM;
TDB_LOG((tdb, TDB_DEBUG_ERROR,"tdb_alloc_read malloc failed len=%d (%s)\n",