2021-04-27 18:33:31 +02:00
|
|
|
#include <stdio.h>
|
|
|
|
#include <string.h>
|
|
|
|
#include "conio.h"
|
|
|
|
#include <errno.h>
|
|
|
|
#include <limits.h>
|
|
|
|
|
|
|
|
char *gets(char* str)
|
|
|
|
{
|
2021-05-25 17:38:14 +02:00
|
|
|
con_init();
|
|
|
|
if(con_gets(str, STDIO_MAX_MEM)==NULL){
|
2021-04-27 18:33:31 +02:00
|
|
|
errno = EIO;
|
|
|
|
return NULL;
|
|
|
|
}
|
2021-07-24 23:28:39 +02:00
|
|
|
|
|
|
|
int str_len = strlen(str);
|
|
|
|
if(str[str_len-1]=='\n'){
|
|
|
|
str[str_len-1]='\0';
|
|
|
|
}
|
2021-04-27 18:33:31 +02:00
|
|
|
return str;
|
2021-07-24 23:28:39 +02:00
|
|
|
}
|