fix: be able to write to empty files

Previously when trying to type in an empty file the program would error,
now it no longer does that.

Signed-off-by: Ricky Ayoub <rayoub@redhat.com>