1 diff -ur v8-/src/allocation.h v8/src/allocation.h
2 --- v8-/src/allocation.h 2010-03-09 20:28:45.000000000 -0700
3 +++ v8/src/allocation.h 2010-03-09 21:07:04.000000000 -0700
5 // and StrNDup uses new and calls the FatalProcessOutOfMemory handler
6 // if allocation fails.
7 char* StrDup(const char* str);
8 -char* StrNDup(const char* str, int n);
9 +char* StrNDup(const char* str, size_t n);
12 // Allocation policy for allocating in the C free store using malloc
13 --- v8-3.4.3/src/allocation.cc.orig 2011-06-14 16:53:10.000000000 +0200
14 +++ v8-3.4.3/src/allocation.cc 2011-06-14 19:36:16.581069856 +0200
19 -char* StrNDup(const char* str, int n) {
20 - int length = StrLength(str);
21 +char* StrNDup(const char* str, size_t n) {
22 + size_t length = StrLength(str);
23 if (n < length) length = n;
24 char* result = NewArray<char>(length + 1);
25 memcpy(result, str, length);