summaryrefslogtreecommitdiffstats
path: root/src/c_utils.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/c_utils.c')
-rw-r--r--src/c_utils.c32
1 files changed, 5 insertions, 27 deletions
diff --git a/src/c_utils.c b/src/c_utils.c
index 2414638..048b845 100644
--- a/src/c_utils.c
+++ b/src/c_utils.c
@@ -35,7 +35,7 @@ char
if (line != NULL)
{
ret = ft_strdup(line);
- line[0] = '\0';
+ *line = '\0';
}
tcaps->cpos = 0;
tputs(tgetstr("cr", NULL), 1, ft_putchar);
@@ -44,36 +44,14 @@ char
{
write(1, "\n", 1);
}
- /* ft_printf("[%s][%s]\n", ret, line); */
return (ret);
}
-char
- *c_insert_char(char *str, char c, t_caps *tcaps)
-{
- int i;
- size_t j;
- size_t len;
- char *dst;
+/* char */
+/* *c_insert_char(char *str, char c, t_caps *tcaps) */
+/* { */
- i = -1;
- j = 0;
- len = (ft_strlen(str) + 2);
- if (!(dst = (char*)malloc((len) * sizeof(char))))
- return (NULL);
- while (++i < (int)len)
- {
- if (i == (int)tcaps->cpos)
- dst[i] = c;
- else
- {
- dst[i] = str[j];
- j++;
- }
- }
- ft_memdel((void**)&str);
- return (dst);
-}
+/* } */
char
*c_delchar(char *str, unsigned short cpos)