aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/os_unix.c
diff options
context:
space:
mode:
authorFelipe Oliveira Carvalho <felipekde@gmail.com>2014-05-09 03:30:26 -0300
committerFelipe Oliveira Carvalho <felipekde@gmail.com>2014-05-19 14:50:23 -0300
commit21784aeb005e78f04f4c1d398bc486be0a65248e (patch)
tree5180a6de4bd033571e351d06b04419a3af768198 /src/nvim/os_unix.c
parenta80d7e86c1f088c5b68d8e8929cc72a0d9680f76 (diff)
downloadrneovim-21784aeb005e78f04f4c1d398bc486be0a65248e.tar.gz
rneovim-21784aeb005e78f04f4c1d398bc486be0a65248e.tar.bz2
rneovim-21784aeb005e78f04f4c1d398bc486be0a65248e.zip
Replace alloc() with xmalloc() and remove immediate OOM checks
Diffstat (limited to 'src/nvim/os_unix.c')
-rw-r--r--src/nvim/os_unix.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/nvim/os_unix.c b/src/nvim/os_unix.c
index cc0d9197ef..52627b6a8b 100644
--- a/src/nvim/os_unix.c
+++ b/src/nvim/os_unix.c
@@ -1120,7 +1120,7 @@ int flags; /* EW_* flags */
++len;
}
}
- command = alloc(len);
+ command = xmalloc(len);
/*
* Build the shell command:
@@ -1269,7 +1269,7 @@ int flags; /* EW_* flags */
fseek(fd, 0L, SEEK_END);
len = ftell(fd); /* get size of temp file */
fseek(fd, 0L, SEEK_SET);
- buffer = alloc(len + 1);
+ buffer = xmalloc(len + 1);
i = fread((char *)buffer, 1, len, fd);
fclose(fd);
os_remove((char *)tempname);
@@ -1353,7 +1353,7 @@ int flags; /* EW_* flags */
goto notfound;
}
*num_file = i;
- *file = (char_u **)alloc(sizeof(char_u *) * i);
+ *file = (char_u **)xmalloc(sizeof(char_u *) * i);
/*
* Isolate the individual file names.
@@ -1397,7 +1397,7 @@ int flags; /* EW_* flags */
if (!dir && (flags & EW_EXEC) && !os_can_exe((*file)[i]))
continue;
- p = alloc((unsigned)(STRLEN((*file)[i]) + 1 + dir));
+ p = xmalloc(STRLEN((*file)[i]) + 1 + dir);
STRCPY(p, (*file)[i]);
if (dir)
add_pathsep(p); /* add '/' to a directory name */