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 /test/mandelbrot.cxx | |
| parent | 53d9614adbb728fc4db983c9bb817c6eea870994 (diff) | |
Replace all calls to sprintf() by calls to snprintf().
Diffstat (limited to 'test/mandelbrot.cxx')
| -rw-r--r-- | test/mandelbrot.cxx | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/test/mandelbrot.cxx b/test/mandelbrot.cxx index d6cbe338a..f233ffb63 100644 --- a/test/mandelbrot.cxx +++ b/test/mandelbrot.cxx @@ -72,9 +72,9 @@ int main(int argc, char **argv) { void Drawing_Window::update_label() { char buffer[128]; - sprintf(buffer, "%+.10f", d->X); x_input->value(buffer); - sprintf(buffer, "%+.10f", d->Y); y_input->value(buffer); - sprintf(buffer, "%.2g", d->scale); w_input->value(buffer); + snprintf(buffer, 128, "%+.10f", d->X); x_input->value(buffer); + snprintf(buffer, 128, "%+.10f", d->Y); y_input->value(buffer); + snprintf(buffer, 128, "%.2g", d->scale); w_input->value(buffer); } void Drawing_Area::draw() { @@ -187,7 +187,7 @@ int Drawing_Area::handle(int event) { jbrot.d->jX = X + (ix-x()-W/2)*scale/W; jbrot.d->jY = Y + (H/2-iy+y())*scale/W; static char s[128]; - sprintf(s, "Julia %.7f %.7f",jbrot.d->jX,jbrot.d->jY); + snprintf(s, 128, "Julia %.7f %.7f",jbrot.d->jX,jbrot.d->jY); jbrot.window->label(s); jbrot.window->show(); jbrot.d->new_display(); |
