Prevent file descriptor from unclosed

This commit is contained in:
topjohnwu
2018-11-23 21:15:44 -05:00
parent 762b678d24
commit ec4723096f
3 changed files with 4 additions and 3 deletions

View File

@@ -395,7 +395,7 @@ int file_to_vector(const char *filename, Vector<CharArray> &arr) {
size_t len = 0;
ssize_t read;
FILE *fp = xfopen(filename, "r");
FILE *fp = xfopen(filename, "re");
if (fp == nullptr)
return 1;