Merge pull request #3430 from DavisVaughan/feature/snprintf-only

Swap `sprintf()` for `snprintf()`
This commit is contained in:
Max Brunsfeld 2024-06-24 08:14:54 -07:00 committed by GitHub
commit 9d1ac21392
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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' \