Subversion Repositories Kolibri OS

Rev

Rev 8793 | Blame | Compare with Previous | Last modification | View Log | Download | RSS feed

  1. #include <stdio.h>
  2. #include "conio.h"
  3. #include <errno.h>
  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.     i = fread(str, n-1, sizeof(char), stream);
  15.     if(i<1){ return NULL; }
  16.     return str;
  17. }
  18.    
  19.