Skip to content

Commit

Permalink
fs, feat: access string data safely.
Browse files Browse the repository at this point in the history
  • Loading branch information
xicilion committed Oct 3, 2017
1 parent d04963c commit 94e0ee9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions fibjs/src/fs/fs.cpp
Expand Up @@ -58,8 +58,8 @@ result_t fs_base::openFile(exlib::string fname, exlib::string flags,
bool bChanged = false;
exlib::string member1 = member;
{
int32_t sz = (int32_t)member.length();
const char* buf = member.c_str();
int32_t sz = (int32_t)member1.length();
const char* buf = member1.c_str();
for (int32_t i = 0; i < sz; i++)
if (buf[i] == PATH_SLASH) {
member[i] = '/';
Expand Down

0 comments on commit 94e0ee9

Please sign in to comment.