If the file does not exist, will fopen() also return NULL?
int update_pic(User *user, const char *filename) {
    /* Check if filename is too long. */
    if (strlen(filename) > sizeof(user->profile_pic) - 1) {
        return 2;
    } else if (fopen(filename, "r") == NULL) {
        return 1;
    } else {
        strncpy(user->profile_pic, filename, sizeof(user->profile_pic));
        return 0;
    }
}