Skip to content

Commit da648a9

Browse files
committed
Another substring instance
1 parent ae748fc commit da648a9

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/preprocessor/preprocessor.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -225,16 +225,16 @@ const expandFunctionMacro = (
225225

226226
// Replace the use of the macro with the expansion
227227
const processed = current.replace(
228-
current.substr(startMatch.index, matchLength),
228+
current.substring(startMatch.index, startMatch.index + matchLength),
229229
expandedReplace
230230
);
231231
// Add text up to the end of the expanded macro to what we've procssed
232-
expanded += processed.substr(0, endOfReplace);
232+
expanded += processed.substring(0, endOfReplace);
233233

234234
// Only work on the rest of the text, not what we already expanded. This is
235235
// to avoid a nested macro #define foo() foo() where we'll try to expand foo
236236
// forever. With this strategy, we expand foo() to foo() and move on
237-
current = processed.substr(endOfReplace);
237+
current = processed.substring(endOfReplace);
238238
}
239239

240240
return expanded + current;

0 commit comments

Comments
 (0)