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:
parent
5692746935
commit
d2e806b611
@ -641,6 +641,10 @@ textarea_edit(int op, struct terminal *term_, struct form_state *fs_,
|
|||||||
|
|
||||||
if (file.length > fc_maxlength) {
|
if (file.length > fc_maxlength) {
|
||||||
file.source[fc_maxlength] = '\0';
|
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"),
|
info_box(term, MSGBOX_FREE_TEXT, N_("Warning"),
|
||||||
ALIGN_CENTER,
|
ALIGN_CENTER,
|
||||||
msg_text(term,
|
msg_text(term,
|
||||||
@ -652,7 +656,7 @@ textarea_edit(int op, struct terminal *term_, struct form_state *fs_,
|
|||||||
" but you can still recover the"
|
" but you can still recover the"
|
||||||
" text that you entered from"
|
" text that you entered from"
|
||||||
" this file: %s"), file.length,
|
" this file: %s"), file.length,
|
||||||
fc_maxlength, fn));
|
(unsigned int) fc_maxlength, fn));
|
||||||
} else {
|
} else {
|
||||||
unlink(fn);
|
unlink(fn);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user