aboutsummaryrefslogtreecommitdiff
path: root/src/regexp.c
diff options
context:
space:
mode:
authorFelipe Oliveira Carvalho <felipekde@gmail.com>2014-05-01 15:07:48 -0300
committerJustin M. Keyes <justinkz@gmail.com>2014-05-07 15:52:27 -0400
commit8704a5832b6d70d0ebc3872468beaea0367f4680 (patch)
treee34df96b21b68162f43713c4f37d4540c0fe3ac7 /src/regexp.c
parent973baa2a06216931747404587461184d83cbdabe (diff)
downloadrneovim-8704a5832b6d70d0ebc3872468beaea0367f4680.tar.gz
rneovim-8704a5832b6d70d0ebc3872468beaea0367f4680.tar.bz2
rneovim-8704a5832b6d70d0ebc3872468beaea0367f4680.zip
Replace lalloc() with xmalloc()
Diffstat (limited to 'src/regexp.c')
-rw-r--r--src/regexp.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/regexp.c b/src/regexp.c
index 73226065d8..35d8e30129 100644
--- a/src/regexp.c
+++ b/src/regexp.c
@@ -1184,7 +1184,6 @@ static void bt_regfree(regprog_T *prog);
*/
static regprog_T *bt_regcomp(char_u *expr, int re_flags)
{
- bt_regprog_T *r;
char_u *scan;
char_u *longest;
int len;
@@ -1211,7 +1210,7 @@ static regprog_T *bt_regcomp(char_u *expr, int re_flags)
#endif
/* Allocate space. */
- r = (bt_regprog_T *)lalloc(sizeof(bt_regprog_T) + regsize, TRUE);
+ bt_regprog_T *r = xmalloc(sizeof(bt_regprog_T) + regsize);
/*
* Second pass: emit code.
@@ -6824,7 +6823,6 @@ char_u *reg_submatch(int no)
{
char_u *retval = NULL;
char_u *s;
- int len;
int round;
linenr_T lnum;
@@ -6832,6 +6830,8 @@ char_u *reg_submatch(int no)
return NULL;
if (submatch_match == NULL) {
+ ssize_t len;
+
/*
* First round: compute the length and allocate memory.
* Second round: copy the text.
@@ -6854,7 +6854,7 @@ char_u *reg_submatch(int no)
} else {
/* Multiple lines: take start line from start col, middle
* lines completely and end line up to end col. */
- len = (int)STRLEN(s);
+ len = STRLEN(s);
if (round == 2) {
STRCPY(retval, s);
retval[len] = '\n';
@@ -6865,7 +6865,7 @@ char_u *reg_submatch(int no)
s = reg_getline_submatch(lnum++);
if (round == 2)
STRCPY(retval + len, s);
- len += (int)STRLEN(s);
+ len += STRLEN(s);
if (round == 2)
retval[len] = '\n';
++len;
@@ -6880,7 +6880,7 @@ char_u *reg_submatch(int no)
}
if (retval == NULL) {
- retval = lalloc((long_u)len, TRUE);
+ retval = xmalloc(len);
}
}
} else {