aboutsummaryrefslogtreecommitdiff
path: root/src/charset.c
diff options
context:
space:
mode:
authorChris Watkins <chris.watkins88@gmail.com>2014-04-27 10:48:08 -0700
committerJustin M. Keyes <justinkz@gmail.com>2014-05-01 16:59:11 -0400
commit67a157c08d28810a9a7b460cb56b9e92d0d77e95 (patch)
treec8c5252a8be9a2d0546482b6336a215bb6f970bf /src/charset.c
parent1b5217687abf8e1aeabaf4e5a64073177d56e593 (diff)
downloadrneovim-67a157c08d28810a9a7b460cb56b9e92d0d77e95.tar.gz
rneovim-67a157c08d28810a9a7b460cb56b9e92d0d77e95.tar.bz2
rneovim-67a157c08d28810a9a7b460cb56b9e92d0d77e95.zip
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.
Diffstat (limited to 'src/charset.c')
-rw-r--r--src/charset.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/charset.c b/src/charset.c
index 89ce5d38eb..5217eb2c0a 100644
--- a/src/charset.c
+++ b/src/charset.c
@@ -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;