am I returning the correct value?

int find_network_newline(const char *buf, int n) {
    for (int i = 0; i < (n - 1); i++) {
        if (buf[i] == '\r' && buf[i + 1] == '\n') {
            return 1 + (i + 1);
        }
    }
    return -1;
}