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/demo.cxx | |
| parent | 53d9614adbb728fc4db983c9bb817c6eea870994 (diff) | |
Replace all calls to sprintf() by calls to snprintf().
Diffstat (limited to 'test/demo.cxx')
| -rw-r--r-- | test/demo.cxx | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/test/demo.cxx b/test/demo.cxx index 0dbe41ed4..e23907ba6 100644 --- a/test/demo.cxx +++ b/test/demo.cxx @@ -407,17 +407,17 @@ void dobut(Fl_Widget *, long arg) { if (params[0]) { // we assume that we have only one argument which is a filename in 'data_path' - sprintf(command, "open '%s/%s%s' --args '%s/%s'", path, cmdbuf, suffix, data_path, params); + snprintf(command, sizeof(command), "open '%s/%s%s' --args '%s/%s'", path, cmdbuf, suffix, data_path, params); } else { - sprintf(command, "open '%s/%s%s'", path, cmdbuf, suffix); + snprintf(command, sizeof(command), "open '%s/%s%s'", path, cmdbuf, suffix); } #else // other platforms if (params[0]) - sprintf(command, "%s/%s%s %s", path, cmdbuf, suffix, params); + snprintf(command, sizeof(command), "%s/%s%s %s", path, cmdbuf, suffix, params); else - sprintf(command, "%s/%s%s", path, cmdbuf, suffix); + snprintf(command, sizeof(command), "%s/%s%s", path, cmdbuf, suffix); #endif |
