mirror of
https://github.com/nextcloud/desktop.git
synced 2024-11-25 22:46:04 +03:00
Fix null termination.
This commit is contained in:
parent
e41e8e1610
commit
b1f8ab38c9
1 changed files with 1 additions and 1 deletions
|
@ -46,7 +46,7 @@ static int csync_journal_check(const char *journal) {
|
||||||
fd = open(journal, O_RDONLY);
|
fd = open(journal, O_RDONLY);
|
||||||
if (fd >= 0) {
|
if (fd >= 0) {
|
||||||
if (read(fd, (void *) buf, (size_t) BUF_SIZE - 1) >= 0) {
|
if (read(fd, (void *) buf, (size_t) BUF_SIZE - 1) >= 0) {
|
||||||
buf[BUF_SIZE] = '\0';
|
buf[BUF_SIZE - 1] = '\0';
|
||||||
close(fd);
|
close(fd);
|
||||||
if (c_streq(buf, "SQLite format 3")) {
|
if (c_streq(buf, "SQLite format 3")) {
|
||||||
if (sqlite3_open(journal, &db ) == SQLITE_OK) {
|
if (sqlite3_open(journal, &db ) == SQLITE_OK) {
|
||||||
|
|
Loading…
Reference in a new issue