diff options
| author | ManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com> | 2022-09-26 16:12:18 +0200 |
|---|---|---|
| committer | ManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com> | 2022-09-26 16:12:18 +0200 |
| commit | 2ffd4e4f1af16b17a286ff354603a717f5d828a5 (patch) | |
| tree | 99e2d4a7e2fde8e3abb027eb687901440750ee00 /src/Fl_Spinner.cxx | |
| parent | 53d9614adbb728fc4db983c9bb817c6eea870994 (diff) | |
Replace all calls to sprintf() by calls to snprintf().
Diffstat (limited to 'src/Fl_Spinner.cxx')
| -rw-r--r-- | src/Fl_Spinner.cxx | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/Fl_Spinner.cxx b/src/Fl_Spinner.cxx index 65e5fcf74..51657d87b 100644 --- a/src/Fl_Spinner.cxx +++ b/src/Fl_Spinner.cxx @@ -79,14 +79,14 @@ void Fl_Spinner::update() { // Fl_Valuator::format() and works well (but looks ugly) int c = 0; char temp[64], *sp = temp; - sprintf(temp, "%.12f", step_); + snprintf(temp, 64, "%.12f", step_); while (*sp) sp++; sp--; while (sp > temp && *sp == '0') sp--; while (sp > temp && (*sp >= '0' && *sp <= '9')) { sp--; c++; } - sprintf(s, format_, c, value_); + snprintf(s, sizeof(s), format_, c, value_); } else { - sprintf(s, format_, value_); + snprintf(s, sizeof(s), format_, value_); } input_.value(s); } |
