Switched n from long to ssize_t