Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(335)

Unified Diff: runtime/bin/directory_macos.cc

Issue 12212090: Remove use of strnlen on Mac OS, because pre-Lion versions don't have it. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/bin/directory_macos.cc
diff --git a/runtime/bin/directory_macos.cc b/runtime/bin/directory_macos.cc
index 7c95159e2dbba2adfbb4f371110a306a09f81d2d..8a0f2b7fcf642a07401d2628d2be09349d960b74 100644
--- a/runtime/bin/directory_macos.cc
+++ b/runtime/bin/directory_macos.cc
@@ -29,7 +29,7 @@ class PathBuffer {
"%s",
name);
data[PATH_MAX] = '\0';
- if (written == strnlen(name, PATH_MAX + 1)) {
+ if (written == strlen(name)) {
length += written;
return true;
} else {
@@ -69,7 +69,7 @@ static PathBuffer* ComputeFullPath(const char* dir_name) {
delete path;
return NULL;
}
- path->length = strnlen(path->data, PATH_MAX);
+ path->length = strlen(path->data);
if (path->Add(File::PathSeparator())) {
return path;
} else {
@@ -384,7 +384,7 @@ char* Directory::CreateTemp(const char* const_template) {
delete path;
return NULL;
}
- int length = strnlen(path->data, PATH_MAX);
+ int length = strlen(path->data);
result = static_cast<char*>(malloc(length + 1));
strncpy(result, path->data, length);
result[length] = '\0';
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698