Changeset 43962 in webkit for trunk/JavaScriptCore/runtime
- Timestamp:
- May 21, 2009, 1:41:29 AM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/runtime/NumberPrototype.cpp
r43457 r43962 83 83 84 84 if (static_cast<int>(length) <= decimalPoint) { 85 strcpy(buf.data(), result); 85 ASSERT(decimalPoint < 1024); 86 memcpy(buf.data(), result, length); 86 87 memset(buf.data() + length, '0', decimalPoint - length); 87 88 } else 88 89 strncpy(buf.data(), result, decimalPoint); 89 90 90 buf[decimalPoint] = '\0'; 91 91 92 str.append(buf.data()); 92 93 } … … 278 279 i += fractionalDigits; 279 280 } else { 280 strcpy(buf + i, result + 1); 281 ASSERT(i + resultLength - 1 < 80); 282 memcpy(buf + i, result + 1, resultLength - 1); 281 283 i += static_cast<int>(resultLength) - 1; 282 284 } … … 355 357 buf[i++] = '-'; 356 358 357 if (decimalPoint == 999) // ? 9999 is the magical "result is Inf or NaN" value. what's 999?? 358 strcpy(buf + i, result); 359 else { 359 // ? 9999 is the magical "result is Inf or NaN" value. what's 999?? 360 if (decimalPoint == 999) { 361 ASSERT(i + resultLength < 80); 362 memcpy(buf + i, result, resultLength); 363 buf[i + resultLength] = '\0'; 364 } else { 360 365 buf[i++] = result[0]; 361 366
Note:
See TracChangeset
for help on using the changeset viewer.