home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
GEMini Atari
/
GEMini_Atari_CD-ROM_Walnut_Creek_December_1993.iso
/
zip
/
mint
/
mntlib16.lzh
/
MNTLIB16
/
GETS.C
< prev
next >
Wrap
C/C++ Source or Header
|
1993-08-03
|
392b
|
25 lines
#include <stdio.h>
#include <assert.h>
char *gets(data)
register char *data;
{
register char *p = data;
register int c;
assert((data != NULL));
while(((c = getc(stdin)) != EOF) && (c != '\n'))
{
if(c == '\b')
{
if(p > data)
--p;
}
else
*p++ = c;
}
*p = '\0';
return(((c == EOF) && (p == data)) ? NULL : data); /* NULL == EOF */
}