summaryrefslogtreecommitdiff
path: root/lib/libc/stdio/fgets.c
blob: adeae1b4edc6edadcc08b2e6998e211ca829e6bf (plain)
1
2
3
4
5
6
7
8
9
10
11
#include "stddef.h" // for NULL

#include <libc.h>  // for weak_reference
#include <stdio.h> // for fread, FILE, fgets

char *fgets(char *restrict s, int n, FILE *restrict stream)
{
	return fread(s, 1, n, stream) ? s : NULL;
}

weak_reference(fgets, fgets_unlocked);