From 1310895f326b77f95f25587f3bde3ca0b51cd83e Mon Sep 17 00:00:00 2001 From: Alex 'AdUser' Z Date: Wed, 28 Dec 2016 17:41:15 +1000 Subject: [PATCH] * return proper error code in macro DB_READ/DB_WRITE --- src/database.c | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/src/database.c b/src/database.c index c366d32..5e41b8b 100644 --- a/src/database.c +++ b/src/database.c @@ -22,18 +22,12 @@ errno = 0; \ memset((buf), 0x0, (len)); \ bytes = pread((db)->fd, (buf), (len), (off)); \ - if (errno) { \ - strncpy((db)->error, strerror(errno), sizeof(db->error)); \ - return IMDB_ERR_SYSTEM; \ - } + if (errno) { return IMDB_ERR_SYSTEM; } #define DB_WRITE(db, buf, len, off) \ errno = 0; \ bytes = pwrite((db)->fd, (buf), (len), (off)); \ - if (errno) { \ - strncpy((db)->error, strerror(errno), sizeof(db->error)); \ - return IMDB_ERR_SYSTEM; \ - } + if (errno) { return IMDB_ERR_SYSTEM; } const char *imdb_hdr_fmt = "IMDB v%02u, CAPS: %s;";