Ruby: Make getFormatArgument 0-indexed

This commit is contained in:
Harry Maclean
2022-03-21 12:22:31 +13:00
parent c73dc8ad0c
commit c253bddbe0

View File

@@ -21,7 +21,7 @@ abstract class PrintfStyleCall extends DataFlow::CallNode {
/**
* Gets then `n`th formatted argument of this call.
*/
DataFlow::Node getFormatArgument(int n) { n > 0 and result = this.getArgument(n) }
DataFlow::Node getFormatArgument(int n) { n >= 0 and result = this.getArgument(n + 1) }
}
/**