aboutsummaryrefslogtreecommitdiff
path: root/src/lsh_main_func.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/lsh_main_func.c')
-rw-r--r--src/lsh_main_func.c12
1 files changed, 2 insertions, 10 deletions
diff --git a/src/lsh_main_func.c b/src/lsh_main_func.c
index 52c016b..ea2729d 100644
--- a/src/lsh_main_func.c
+++ b/src/lsh_main_func.c
@@ -36,11 +36,7 @@ char *lsh_read_line(void)
// If we have exceeded the buffer, reallocate.
if (position >= bufsize) {
bufsize += LSH_RL_BUFSIZE;
- buffer = realloc(buffer, bufsize);
- if (!buffer) {
- fprintf(stderr, "lsh: allocation error\n");
- exit(EXIT_FAILURE);
- }
+ buffer = realloce(buffer, bufsize);
}
}
}
@@ -160,11 +156,7 @@ CMD **lsh_split_command(char *line)
if (position * bufsize >= bufsize) {
bufsize += sizeof(CMD*);
- tokens = realloc(tokens, bufsize);
- if (!tokens) {
- fprintf(stderr, "lsh: allocation error\n");
- exit(EXIT_FAILURE);
- }
+ tokens = realloce(tokens, bufsize);
}
// do not make Redirect or Append a actual command to run