1
0
mirror of https://github.com/rkd77/elinks.git synced 2024-12-04 14:46:47 -05:00

textarea_edit: Cast size_t fx_maxlength to match "%u".

This commit is contained in:
Kalle Olavi Niemitalo 2007-03-11 00:25:42 +02:00 committed by Witold Filipczyk
parent 5692746935
commit d2e806b611

View File

@ -641,6 +641,10 @@ textarea_edit(int op, struct terminal *term_, struct form_state *fs_,
if (file.length > fc_maxlength) {
file.source[fc_maxlength] = '\0';
/* Casting size_t fc_maxlength to unsigned int
* and formatting it with "%u" is safe,
* because fc_maxlength is smaller than
* file.length, which is an int. */
info_box(term, MSGBOX_FREE_TEXT, N_("Warning"),
ALIGN_CENTER,
msg_text(term,
@ -652,7 +656,7 @@ textarea_edit(int op, struct terminal *term_, struct form_state *fs_,
" but you can still recover the"
" text that you entered from"
" this file: %s"), file.length,
fc_maxlength, fn));
(unsigned int) fc_maxlength, fn));
} else {
unlink(fn);
}