Implementation of unix utility tail in C
Avoid globals. lines_read is naturally suited to return lines_read.
tail leaks memory. You shall free the line pointed by buffer[....] before reassigning it.
sizeof(char) is guaranteed to be 1.


I don't remember at which point K&amp;R offer this exercise. In any case,


The line-reading loop is better expressed as fgets.
malloc/strcpy combination is a long way to say strdup.