1
0
mirror of https://github.com/armink/FlashDB.git synced 2025-01-29 04:32:53 +08:00

[fdb_utils][_fdb_flash_write]: fix returned incorrect error code. (#300)

If user has set file mode, but file mode is disabled, _fdb_flash_write should return FDB_WRITE_ERR, not FDB_READ_ERR.
This commit is contained in:
Kenny Zhang 2024-07-26 09:44:36 +08:00 committed by GitHub
parent 8f80336b89
commit a8e8dcad64
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -304,7 +304,7 @@ fdb_err_t _fdb_flash_write(fdb_db_t db, uint32_t addr, const void *buf, size_t s
#ifdef FDB_USING_FILE_MODE
return _fdb_file_write(db, addr, buf, size, sync);
#else
return FDB_READ_ERR;
return FDB_WRITE_ERR;
#endif /* FDB_USING_FILE_MODE */
} else {
#ifdef FDB_USING_FAL_MODE