mirror of https://github.com/wolfSSL/wolfssh.git
Fix warning for unchecked errno in WREWIND macro
Replace rewind() with fseek(s, 0, SEEK_SET) in the WREWIND macro. rewind() internally clears errno, which scan-build flags as overwriting a previously unchecked errno value. fseek() to offset 0 is functionally equivalent without the implicit errno reset.pull/943/head
parent
1b971ffaf4
commit
97ad915726
|
|
@ -449,7 +449,8 @@ extern "C" {
|
|||
#define WFSEEK(fs,s,o,w) fseek((s),(o),(w))
|
||||
#define WFTELL(fs,s) ftell((s))
|
||||
#define WFSTAT(fs,fd,b) fstat((fd),(b))
|
||||
#define WREWIND(fs,s) rewind((s))
|
||||
#define WREWIND(fs,s) do { fseek((s),0,SEEK_SET); \
|
||||
clearerr((s)); } while (0)
|
||||
#define WSEEK_END SEEK_END
|
||||
#define WBADFILE NULL
|
||||
#define WSETTIME(fs,f,a,m) (0)
|
||||
|
|
|
|||
Loading…
Reference in New Issue