Skip to content

Commit 49555ec

Browse files
authored
Fix for compilation error
~/Arduino/libraries/Sqlite3Esp32/src/esp32.cpp: In function 'int ESP32Open(sqlite3_vfs*, const char*, sqlite3_file*, int, int*)': ~/Arduino/libraries/Sqlite3Esp32/src/esp32.cpp:457:12: error: ordered comparison of pointer with integer zero ('FILE*' and 'int') 457 | if( p->fp<=0){ | ~~~~~^~~ ~/Arduino/libraries/Sqlite3Esp32/src/esp32.cpp: In function 'int ESP32Delete(sqlite3_vfs*, const char*, int)': ~/Arduino/libraries/Sqlite3Esp32/src/esp32.cpp:499:12: error: ordered comparison of pointer with integer zero ('FILE*' and 'int') 499 | if( dfd<=0 ){ | ~~~^~~
1 parent f4f401f commit 49555ec

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/esp32.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -447,7 +447,7 @@ static int ESP32Open(
447447
//p->fd = open(zName, oflags, 0600);
448448
//p->fd = open(zName, oflags, S_IRUSR | S_IWUSR);
449449
p->fp = fopen(zName, mode);
450-
if( p->fp<=0){
450+
if( p->fp == (void *)NULL ) {
451451
if (aBuf)
452452
sqlite3_free(aBuf);
453453
//Serial.println("Can't open");
@@ -489,7 +489,7 @@ static int ESP32Delete(sqlite3_vfs *pVfs, const char *zPath, int dirSync){
489489

490490
/* Open a file-descriptor on the directory. Sync. Close. */
491491
dfd = fopen(zDir, "r");
492-
if( dfd<=0 ){
492+
if( dfd == (void *)NULL ){
493493
rc = -1;
494494
}else{
495495
rc = fflush(dfd);

0 commit comments

Comments
 (0)