add more escape codes to printf

This commit is contained in:
Murphy 2023-05-02 14:43:47 -04:00
parent ab7109065c
commit f6e64afaee

View file

@ -72,6 +72,19 @@ static void handle_slash(char n) {
case 'b': case 'b':
putchar('\b'); putchar('\b');
break; break;
case 'f':
putchar('\f');
break;
case 'e':
putchar('\e');
case 'a':
putchar('\a');
break;
case '"':
putchar('"');
break;
case 'c':
exit(EXIT_SUCCESS);
default: default:
putchar('\\'); putchar('\\');
putchar(n); putchar(n);