fix: infinite loop when reading CSV file EOF on Windows

This commit is contained in:
Haolin Wang 2024-12-27 17:16:00 +08:00
parent ddd5ddab9c
commit 922766c145
1 changed files with 1 additions and 1 deletions

View File

@ -1403,7 +1403,7 @@ int64_t taosGetLineFile(TdFilePtr pFile, char **__restrict ptrBuf) {
}
(*ptrBuf)[totalBytesRead] = '\0';
ret = totalBytesRead;
ret = (totalBytesRead > 0 ? totalBytesRead : -1); // -1 means EOF
#else
size_t len = 0;
ret = getline(ptrBuf, &len, pFile->fp);