This fuction writes string to a dynamically allocated buffer, but line 25 is raising a warning. Why?
int print_user(const User* user) {
    if (user == NULL) {
        return 1;
    }

    // let us first go through this user first to see how much memory we need to allocate:
    int total_chars = get_size_buf_user(user);
    // we need extra 2 spaces for \r\n
    char* buff = malloc(sizeof(char) * (total_chars + 2));
    char* offset = buff;
    int max_chars = total_chars + 1;
    // Now, let's actually write stuff in the buffer:
    // For that let us go through this user's attributes again

    int written_chars = snprintf(offset, max_chars, "%s", "Name: %s\n\n");
    // check for errors in sprintf
    if (written_chars < 0 || written_chars > total_chars) {
        perror("writting to buffer with snprintf");
    }
    max_chars -= written_chars;
    offset += written_chars;

    written_chars = snprintf(offset, max_chars, "%s", user->name);
    // check for errors in sprintf
    if (written_chars < 0 || written_chars > total_chars) {
        perror("writting to buffer with snprintf");
    }
    max_chars -= written_chars;
    offset += written_chars;