Subversion Repositories Kolibri OS

Rev

Rev 8687 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
8687 turbocat 1
#include 
2
#include "conio.h"
3
#include 
4
 
5
char *fgets(char *str, int n, FILE *stream)
6
{
7
    int i=0, sym_code;
8
 
9
    if(!stream || !str){
10
        errno = EINVAL;
11
        return NULL;
12
    }
13
 
14
    while (i
15
        sym_code = fgetc(stream);
16
        if(sym_code =='\n' || sym_code == EOF){ break; }
17
        str[i]=(char)sym_code;
18
        i++;
19
    }
20
 
21
    if(i<1){ return NULL; }
22
    return str;
23
}
24