Skip to content
This repository has been archived by the owner on Apr 22, 2023. It is now read-only.

Commit

Permalink
Fs: use strncmp instead of memcmp for comparing strings
Browse files Browse the repository at this point in the history
  • Loading branch information
piscisaureus committed Nov 25, 2011
1 parent 1f16a7b commit 5b014e0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/node_file.cc
Expand Up @@ -256,9 +256,9 @@ Local<Value> FSError(int errorno,

if (path) {
#ifdef _WIN32
if (memcmp(path, "\\\\?\\UNC\\", 8) == 0) {
if (strncmp(path, "\\\\?\\UNC\\", 8) == 0) {
path_str = String::Concat(String::New("\\\\"), String::New(path + 8));
} else if (memcmp(path, "\\\\?\\", 4) == 0) {
} else if (strncmp(path, "\\\\?\\", 4) == 0) {
path_str = String::New(path + 4);
} else {
path_str = String::New(path);
Expand Down

0 comments on commit 5b014e0

Please sign in to comment.