mirror of
https://github.com/neovim/neovim.git
synced 2025-09-29 14:38:32 +00:00
Replace 'alloc' with 'xmalloc' in some files.
Files changed: charset.c, buffer.c, diff.c, edit.c, ex_cmds.c, ex_cmds2.c and ex_docmd.c. The remaining alloc's in these files require more careful attention to remove.
This commit is contained in:

committed by
Justin M. Keyes

parent
1b5217687a
commit
67a157c08d
@@ -335,13 +335,13 @@ char_u *transstr(char_u *s)
|
||||
{
|
||||
char_u *res;
|
||||
char_u *p;
|
||||
int l, len, c;
|
||||
int l, c;
|
||||
char_u hexbuf[11];
|
||||
|
||||
if (has_mbyte) {
|
||||
// Compute the length of the result, taking account of unprintable
|
||||
// multi-byte characters.
|
||||
len = 0;
|
||||
size_t len = 0;
|
||||
p = s;
|
||||
|
||||
while (*p != NUL) {
|
||||
@@ -353,7 +353,7 @@ char_u *transstr(char_u *s)
|
||||
len += l;
|
||||
} else {
|
||||
transchar_hex(hexbuf, c);
|
||||
len += (int)STRLEN(hexbuf);
|
||||
len += STRLEN(hexbuf);
|
||||
}
|
||||
} else {
|
||||
l = byte2cells(*p++);
|
||||
@@ -366,9 +366,9 @@ char_u *transstr(char_u *s)
|
||||
}
|
||||
}
|
||||
}
|
||||
res = alloc((unsigned)(len + 1));
|
||||
res = xmallocz(len);
|
||||
} else {
|
||||
res = alloc((unsigned)(vim_strsize(s) + 1));
|
||||
res = xmallocz(vim_strsize(s));
|
||||
}
|
||||
|
||||
*res = NUL;
|
||||
|
Reference in New Issue
Block a user