Everything works. I tested it. I also added a function that null-terminates a \n-terminated string.
We probably won't need it, but whatever.