mirror of
https://github.com/neovim/neovim.git
synced 2025-09-28 05:58:33 +00:00
Remove OOM error handling code after calls to transstr()
transstr() doesn't return NULL anymore.
This commit is contained in:

committed by
Thiago de Arruda

parent
b8bda77e39
commit
b4545740fd
@@ -330,7 +330,7 @@ void trans_characters(char_u *buf, int bufsize)
|
|||||||
///
|
///
|
||||||
/// @param s
|
/// @param s
|
||||||
///
|
///
|
||||||
/// @return translated string or NULL if out of memory.
|
/// @return translated string
|
||||||
char_u *transstr(char_u *s)
|
char_u *transstr(char_u *s)
|
||||||
{
|
{
|
||||||
char_u *res;
|
char_u *res;
|
||||||
@@ -371,7 +371,6 @@ char_u *transstr(char_u *s)
|
|||||||
res = alloc((unsigned)(vim_strsize(s) + 1));
|
res = alloc((unsigned)(vim_strsize(s) + 1));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (res != NULL) {
|
|
||||||
*res = NUL;
|
*res = NUL;
|
||||||
p = s;
|
p = s;
|
||||||
|
|
||||||
@@ -390,7 +389,7 @@ char_u *transstr(char_u *s)
|
|||||||
STRCAT(res, transchar_byte(*p++));
|
STRCAT(res, transchar_byte(*p++));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -344,7 +344,6 @@ void pum_redraw(void)
|
|||||||
*p = saved;
|
*p = saved;
|
||||||
|
|
||||||
if (curwin->w_p_rl) {
|
if (curwin->w_p_rl) {
|
||||||
if (st != NULL) {
|
|
||||||
char_u *rt = reverse_text(st);
|
char_u *rt = reverse_text(st);
|
||||||
|
|
||||||
if (rt != NULL) {
|
if (rt != NULL) {
|
||||||
@@ -372,7 +371,7 @@ void pum_redraw(void)
|
|||||||
vim_free(rt_start);
|
vim_free(rt_start);
|
||||||
}
|
}
|
||||||
vim_free(st);
|
vim_free(st);
|
||||||
}
|
|
||||||
col -= width;
|
col -= width;
|
||||||
} else {
|
} else {
|
||||||
if (st != NULL) {
|
if (st != NULL) {
|
||||||
|
@@ -5163,10 +5163,8 @@ win_redr_custom (
|
|||||||
|
|
||||||
/* Make all characters printable. */
|
/* Make all characters printable. */
|
||||||
p = transstr(buf);
|
p = transstr(buf);
|
||||||
if (p != NULL) {
|
|
||||||
vim_strncpy(buf, p, sizeof(buf) - 1);
|
vim_strncpy(buf, p, sizeof(buf) - 1);
|
||||||
vim_free(p);
|
vim_free(p);
|
||||||
}
|
|
||||||
|
|
||||||
/* fill up with "fillchar" */
|
/* fill up with "fillchar" */
|
||||||
len = (int)STRLEN(buf);
|
len = (int)STRLEN(buf);
|
||||||
|
Reference in New Issue
Block a user