Swap sprintf() for snprintf()

This commit is contained in:
Davis Vaughan 2024-06-24 09:56:24 -04:00
parent 34c4784ac5
commit 218a071d33

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