From 218a071d338e11c02141f05fbb6b3627e4e6f546 Mon Sep 17 00:00:00 2001 From: Davis Vaughan Date: Mon, 24 Jun 2024 09:56:24 -0400 Subject: [PATCH] Swap `sprintf()` for `snprintf()` --- lib/src/parser.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/src/parser.c b/lib/src/parser.c index 4d64f373..1c372c54 100644 --- a/lib/src/parser.c +++ b/lib/src/parser.c @@ -33,7 +33,11 @@ if (self->lexer.logger.log || self->dot_graph_file) { \ char *buf = self->lexer.debug_buffer; \ const char *symbol = symbol_name; \ - int off = sprintf(buf, "lexed_lookahead sym:"); \ + int off = snprintf( \ + buf, \ + TREE_SITTER_SERIALIZATION_BUFFER_SIZE, \ + "lexed_lookahead sym:" \ + ); \ for ( \ int i = 0; \ symbol[i] != '\0' \