ft_putstr_non_printable.c

This commit is contained in:
Timo Schmidt 2023-03-28 14:54:52 +02:00
parent dd0c58e2b2
commit 6b9b64029f
1 changed files with 2 additions and 2 deletions

View File

@ -6,7 +6,7 @@
/* By: tischmid <marvin@42.fr> +#+ +:+ +#+ */ /* By: tischmid <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */ /* +#+#+#+#+#+ +#+ */
/* Created: 2023/03/21 02:59:50 by tischmid #+# #+# */ /* Created: 2023/03/21 02:59:50 by tischmid #+# #+# */
/* Updated: 2023/03/24 01:04:50 by tischmid ### ########.fr */ /* Updated: 2023/03/28 14:54:20 by tischmid ### ########.fr */
/* */ /* */
/* ************************************************************************** */ /* ************************************************************************** */
@ -17,7 +17,7 @@ void ft_putstr_non_printable(char *str)
{ {
while (*str) while (*str)
{ {
if (*str < 32) if (*str < 32 || *str == 127)
{ {
write(1, "\\", 1); write(1, "\\", 1);
write(1, &HEX_ALPH[*(unsigned char *) str / 16], 1); write(1, &HEX_ALPH[*(unsigned char *) str / 16], 1);