source: freewrt/tools/paxmirabilis/fgetln.c@ 9e17a74

freewrt_1_0 freewrt_2_0
Last change on this file since 9e17a74 was 9e17a74, checked in by Thorsten Glaser <tg@…>, 19 years ago

correct requirement headers

git-svn-id: svn://www.freewrt.org/trunk/freewrt@220 afb5a338-a214-0410-bd46-81f09a774fd1

  • Property mode set to 100644
File size: 421 bytes
Line 
1#define _GNU_SOURCE
2#include <sys/types.h>
3#include <sys/cdefs.h>
4#include <stdio.h>
5#include <string.h>
6
7#ifdef __GLIBC__
8char *
9fgetln (stream, len)
10 FILE *stream;
11 size_t *len;
12{
13 char *line=NULL;
14 size_t nread = 0;
15
16 while (nread == 1) {
17 nread = getline (&line, len, stream);
18 if (nread == -1)
19 return NULL;
20 }
21
22 (*len)--; /* get rid of the trailing \0, fgetln
23 does not have it */
24
25 return line;
26}
27#endif
Note: See TracBrowser for help on using the repository browser.