| Index: test/cctest/test-debug.cc
|
| diff --git a/test/cctest/test-debug.cc b/test/cctest/test-debug.cc
|
| index 92e18e06857d7db356d80436e75163872c81504f..23d1a576fa8adbe2c798d3094178bcef14b05632 100644
|
| --- a/test/cctest/test-debug.cc
|
| +++ b/test/cctest/test-debug.cc
|
| @@ -3884,6 +3884,11 @@ bool IsEvaluateResponseMessage(char* message) {
|
| }
|
|
|
|
|
| +static int StringToInt(const char* s) {
|
| + return atoi(s); // NOLINT
|
| +}
|
| +
|
| +
|
| // We match parts of the message to get evaluate result int value.
|
| int GetEvaluateIntResult(char *message) {
|
| const char* value = "\"value\":";
|
| @@ -3892,7 +3897,7 @@ int GetEvaluateIntResult(char *message) {
|
| return -1;
|
| }
|
| int res = -1;
|
| - res = atoi(pos + strlen(value));
|
| + res = StringToInt(pos + strlen(value));
|
| return res;
|
| }
|
|
|
| @@ -3905,7 +3910,7 @@ int GetBreakpointIdFromBreakEventMessage(char *message) {
|
| return -1;
|
| }
|
| int res = -1;
|
| - res = atoi(pos + strlen(breakpoints));
|
| + res = StringToInt(pos + strlen(breakpoints));
|
| return res;
|
| }
|
|
|
| @@ -3918,11 +3923,7 @@ int GetTotalFramesInt(char *message) {
|
| return -1;
|
| }
|
| pos += strlen(prefix);
|
| - char* pos_end = pos;
|
| - int res = static_cast<int>(strtol(pos, &pos_end, 10));
|
| - if (pos_end == pos) {
|
| - return -1;
|
| - }
|
| + int res = StringToInt(pos);
|
| return res;
|
| }
|
|
|
|
|