Replace calls to sprintf() with strlcpy() in settings.c.

sprintf() was being used to copy a string constant with
no formatting verbs; just use strlcpy() instead.

Signed-off-by: Dan Cross <patchdev@fat-dragon.org>
This commit is contained in:
Dan Cross 2018-10-15 14:37:51 +00:00 committed by Andrew Pamment
parent 588242f68e
commit f1361379af

View File

@ -26,13 +26,13 @@ void settings_menu(struct user_record *user) {
s_printf(get_string(221), (user->codepage ? "UTF-8" : "CP437"));
switch (user->exteditor) {
case 0:
sprintf(buffer, "NO");
strlcpy(buffer, "NO", sizeof buffer);
break;
case 1:
sprintf(buffer, "YES");
strlcpy(buffer, "YES", sizeof buffer);
break;
case 2:
sprintf(buffer, "ASK");
strlcpy(buffer, "ASK", sizeof buffer);
break;
}
s_printf(get_string(222), buffer);