From b4dddad64122649d9da6340032275d1756930e74 Mon Sep 17 00:00:00 2001 From: epoch Date: Fri, 9 Dec 2016 15:54:33 -0600 Subject: LOTS OF SHIT --- tests/readline.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 tests/readline.c (limited to 'tests/readline.c') diff --git a/tests/readline.c b/tests/readline.c new file mode 100644 index 0000000..76d6a2d --- /dev/null +++ b/tests/readline.c @@ -0,0 +1,20 @@ +#include +#include + +char *read_line_hack(FILE *fp,int len) { + short in; + char *t; + if((in=fgetc(fp)) == '\n') { + t=malloc(len+1); + t[len]=0; + return t; + } + t=read_line_hack(fp,len+1); + t[len]=in; + return t; +} + +int main() { + char *t=read_line_hack(stdin,0); + printf("%s\n",t); +} -- cgit v1.2.3