diff --git a/src/csync_journal.c b/src/csync_journal.c index de27b1a6e..7d4e31380 100644 --- a/src/csync_journal.c +++ b/src/csync_journal.c @@ -46,7 +46,7 @@ static int csync_journal_check(const char *journal) { fd = open(journal, O_RDONLY); if (fd >= 0) { if (read(fd, (void *) buf, (size_t) BUF_SIZE - 1) >= 0) { - buf[BUF_SIZE] = '\0'; + buf[BUF_SIZE - 1] = '\0'; close(fd); if (c_streq(buf, "SQLite format 3")) { if (sqlite3_open(journal, &db ) == SQLITE_OK) {