Skip to content

Commit af3658c

Browse files
use abstract file calls
1 parent 657db7c commit af3658c

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

apps/wolfsshd/wolfsshd.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -208,20 +208,20 @@ static byte* getBufferFromFile(const char* fileName, word32* bufSz, void* heap)
208208

209209
if (WFOPEN(&file, fileName, "rb") != 0)
210210
return NULL;
211-
fseek(file, 0, XSEEK_END);
212-
fileSz = (word32)ftell(file);
213-
rewind(file);
211+
WFSEEK(file, 0, XSEEK_END);
212+
fileSz = (word32)WFTELL(file);
213+
WREWIND(file);
214214

215215
buf = (byte*)WMALLOC(fileSz + 1, heap, DYNTYPE_SSHD);
216216
if (buf != NULL) {
217-
readSz = (word32)fread(buf, 1, fileSz, file);
217+
readSz = (word32)WFREAD(buf, 1, fileSz, file);
218218
if (readSz < fileSz) {
219-
fclose(file);
219+
WFCLOSE(file);
220220
WFREE(buf, heap, DYNTYPE_SSHD);
221221
return NULL;
222222
}
223223
*bufSz = readSz;
224-
fclose(file);
224+
WFCLOSE(file);
225225
}
226226

227227
(void)heap;

0 commit comments

Comments
 (0)