Return to test-getline.c CVS log | Up to [cvsweb.bsd.lv] / mandoc |
File: [cvsweb.bsd.lv] / mandoc / test-getline.c (download)
Revision 1.1, Sat Nov 7 20:52:52 2015 UTC (8 years, 10 months ago) by schwarze
provide a simple stand-alone implementation of getline(3) for systems lacking it |
#include <sys/types.h> #include <stdio.h> #include <unistd.h> int main(void) { char *line = NULL; size_t linesz = 0; fclose(stdin); return getline(&line, &linesz, stdin) != -1; }