Fix $fscanf etc to return -1 on EOF (#3113).

This commit is contained in:
Wilson Snyder
2022-03-07 17:43:33 -05:00
parent 181b9a5795
commit ef87d057fc
6 changed files with 59 additions and 4 deletions
+1 -1
View File
@@ -1497,7 +1497,7 @@ void VL_FWRITEF(IData fpi, const char* formatp, ...) VL_MT_SAFE {
IData VL_FSCANF_IX(IData fpi, const char* formatp, ...) VL_MT_SAFE {
// While threadsafe, each thread can only access different file handles
FILE* const fp = VL_CVT_I_FP(fpi);
if (VL_UNLIKELY(!fp)) return 0;
if (VL_UNLIKELY(!fp)) return ~0U; // -1
va_list ap;
va_start(ap, formatp);