summaryrefslogtreecommitdiff
path: root/test/utf8.cxx
diff options
context:
space:
mode:
authorManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com>2022-09-26 16:12:18 +0200
committerManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com>2022-09-26 16:12:18 +0200
commit2ffd4e4f1af16b17a286ff354603a717f5d828a5 (patch)
tree99e2d4a7e2fde8e3abb027eb687901440750ee00 /test/utf8.cxx
parent53d9614adbb728fc4db983c9bb817c6eea870994 (diff)
Replace all calls to sprintf() by calls to snprintf().
Diffstat (limited to 'test/utf8.cxx')
-rw-r--r--test/utf8.cxx10
1 files changed, 5 insertions, 5 deletions
diff --git a/test/utf8.cxx b/test/utf8.cxx
index 130f411fa..ce5cd9378 100644
--- a/test/utf8.cxx
+++ b/test/utf8.cxx
@@ -174,11 +174,11 @@ static void font_cb(Fl_Widget *, long)
char buf[16];
if (j < size_count && i == size_array[j])
{
- sprintf(buf, "@b%d", i);
+ snprintf(buf, 16, "@b%d", i);
j++;
}
else
- sprintf(buf, "%d", i);
+ snprintf(buf, 16, "%d", i);
sizeobj->add(buf);
}
sizeobj->value(pickedsize);
@@ -193,7 +193,7 @@ static void font_cb(Fl_Widget *, long)
if (size_array[i] <= pickedsize) w = i;
char buf[16];
- sprintf(buf, "@b%d", size_array[i]);
+ snprintf(buf, 16, "@b%d", size_array[i]);
sizeobj->add(buf);
}
sizeobj->value(w + 1);
@@ -304,7 +304,7 @@ static void own_face_cb(Fl_Widget *, void *)
// Show font in its own face
// this is neat, but really slow on some systems:
// uses each font to display its own name
- sprintf (buffer, "@F%d@.%s", font_idx, name);
+ snprintf (buffer, sizeof(buffer), "@F%d@.%s", font_idx, name);
}
fontobj->add(buffer);
}
@@ -616,7 +616,7 @@ int main(int argc, char** argv)
i++;
}
buf[o] = '\0';
- sprintf(bu, "0x%06lX", y * 16);
+ snprintf(bu, sizeof(bu), "0x%06lX", y * 16);
Fl_Input *b = new Fl_Input(200,(y-off)*25,80,25);
b->textfont(FL_COURIER);
b->value(fl_strdup(bu));