Improving function that compares two strings I'm learning C and have made this very simple function to compare two strings. I would like to know how it can be improved:

int match(char* string1, char* string2)
{
    size_t i = 0;

    while (string1[i] != '\0' || string2[i] != '\0') {
        if (string1[i] != string2[i]) {
            return 0;
        }
        ++i;
    }

    return 1;
}


I figured it will only do 2 comparisons per iteration, and 3 in the last iteration. Also, I believe it won't go beyond the end of any array because it will return before iterating beyond the null terminator.
Your parameters should be const and your loop need only to check one string for the terminator.  For example in the following loop, if *s1 is 0 the loop stops because of the first condition. If *s1 is not 0 but *s2 is 0,  the loop stops because of the 2nd condition.

int match(const char *s1, const char *s2)
{
    while (*s1 &amp;&amp; (*s1++ == *s2++)) {
         // nothing
    }
    return *s1 - *s2;
}