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/fonts.cxx | |
| parent | 53d9614adbb728fc4db983c9bb817c6eea870994 (diff) | |
Replace all calls to sprintf() by calls to snprintf().
Diffstat (limited to 'test/fonts.cxx')
| -rw-r--r-- | test/fonts.cxx | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/test/fonts.cxx b/test/fonts.cxx index 16fec4460..694b1d7bf 100644 --- a/test/fonts.cxx +++ b/test/fonts.cxx @@ -68,8 +68,8 @@ void font_cb(Fl_Widget *, long) { int j = 1; for (int i = 1; i<64 || i<s[n-1]; i++) { char buf[20]; - if (j < n && i==s[j]) {sprintf(buf,"@b%d",i); j++;} - else sprintf(buf,"%d",i); + if (j < n && i==s[j]) {snprintf(buf, 20,"@b%d",i); j++;} + else snprintf(buf, 20,"%d",i); sizeobj->add(buf); } sizeobj->value(pickedsize); @@ -79,7 +79,7 @@ void font_cb(Fl_Widget *, long) { for (int i = 0; i < n; i++) { if (s[i]<=pickedsize) w = i; char buf[20]; - sprintf(buf,"@b%d",s[i]); + snprintf(buf, 20,"@b%d",s[i]); sizeobj->add(buf); } sizeobj->value(w+1); |
