Subversion Repositories Kolibri OS

Rev

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

  1. #include <stdio.h>
  2. #include <string.h>
  3. #include "conio.h"
  4. #include <errno.h>
  5. #include <limits.h>
  6.  
  7. char *gets(char* str)
  8. {
  9.     con_init();
  10.     if(con_gets(str, STDIO_MAX_MEM)==NULL){
  11.         errno = EIO;
  12.         return NULL;
  13.     }
  14.    
  15.     int str_len = strlen(str);
  16.     if(str[str_len-1]=='\n'){
  17.         str[str_len-1]='\0';
  18.     }
  19.     return str;
  20. }
  21.