diff options
Diffstat (limited to 'textscreen/examples/calculator.c')
-rw-r--r-- | textscreen/examples/calculator.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/textscreen/examples/calculator.c b/textscreen/examples/calculator.c index 7c77e838..3db60ef7 100644 --- a/textscreen/examples/calculator.c +++ b/textscreen/examples/calculator.c @@ -49,7 +49,7 @@ void UpdateInputBox(void) { char buf[20]; - sprintf(buf, " %i", input_value); + TXT_snprintf(buf, sizeof(buf), " %i", input_value); TXT_SetLabel(input_box, buf); } @@ -76,7 +76,7 @@ void AddNumberButton(txt_table_t *table, int value) val_copy = malloc(sizeof(int)); *val_copy = value; - sprintf(buf, " %i ", value); + TXT_snprintf(buf, sizeof(buf), " %i ", value); TXT_AddWidget(table, TXT_NewButton2(buf, InsertNumber, val_copy)); } @@ -98,7 +98,7 @@ void AddOperatorButton(txt_table_t *table, char *label, operator_t op) op_copy = malloc(sizeof(operator_t)); *op_copy = op; - sprintf(buf, " %s ", label); + TXT_snprintf(buf, sizeof(buf), " %s ", label); TXT_AddWidget(table, TXT_NewButton2(buf, Operator, op_copy)); } |