mirror of
https://codeberg.org/la-chouette/minishell.git
synced 2025-12-06 07:28:09 +01:00
The problem took me a while to find, but the issue here was that push_buf does not add a terminating null byte, and I was only asking push_buf to copy the bytes that contained characters, not the terminating null byte as well. This, combined with the fact that to remove bytes from the end of the buffer, I just placed a null byte a the end, caused some combinations of indentation and dedentations to overwrite the null byte, and not place a null byte after the new indent, which would still contain data from a previous indentation.
32 lines
1.3 KiB
C
32 lines
1.3 KiB
C
/* ************************************************************************** */
|
|
/* */
|
|
/* ::: :::::::: */
|
|
/* treedrawing.h :+: :+: :+: */
|
|
/* +:+ +:+ +:+ */
|
|
/* By: khais <marvin@42.fr> +#+ +:+ +#+ */
|
|
/* +#+#+#+#+#+ +#+ */
|
|
/* Created: 2025/03/18 12:24:25 by khais #+# #+# */
|
|
/* Updated: 2025/03/19 13:50:37 by khais ### ########.fr */
|
|
/* */
|
|
/* ************************************************************************** */
|
|
|
|
#ifndef TREEDRAWING_H
|
|
# define TREEDRAWING_H
|
|
|
|
# include <stdbool.h>
|
|
# include "buffer/buffer.h"
|
|
|
|
# define CROSS " ├─ "
|
|
# define CORNER " ╰─ "
|
|
# define VERTICAL " │ "
|
|
# define SPACE " "
|
|
|
|
/* # define CROSS " |- " */
|
|
/* # define CORNER " \\- " */
|
|
/* # define VERTICAL " | " */
|
|
/* # define SPACE " " */
|
|
|
|
void indent(t_buffer *indent, bool is_last);
|
|
void dedent(t_buffer *indent, bool is_last);
|
|
|
|
#endif // TREEDRAWING_H
|