
int update_pic(User *user, const char *filename) {
    if (strlen(filename) > MAX_NAME) {
        return 2; // Filename too long
    }
    FILE *file = fopen(filename, "r");
    if (file == NULL) {
        return 1; // File does not exist or cannot be opened
    }
    fclose(file);

    // Update the user's profile picture filename
    strcpy(user->profile_pic, filename);

    return 0; // Success
    return -1;
}
/*
 * Change the filename for the profile pic of the given user.
 *
 * Return:
 *   - 0 on success.
 *   - 1 if the file does not exist or cannot be opened.
 *   - 2 if the filename is too long.
 */