#include #include "getline.h" /** * get_line: Read a line into s, return the length. Read no more than * lim characters. * Note: Renamed from K&R because stdio.h includes another function * with the name getline. */ int get_line (char s[], int lim) { int c, i; for (i=0; i < lim-1 && (c=getchar())!=EOF && c!='\n'; ++i) s[i] = c; if (c == '\n') { s[i] = c; ++i; } s[i] = '\0'; return i; } // get_line