#define	rsts	1
#include <stdio.h>
#include <rsts.h>

extern char *gets();
extern char *fgets();

char *
gets(buffer)
char *buffer;
{
    int c;
    char *ps;

    ps = buffer;
    do {
	if ((c = getchar()) == EOF) {
	    return(NULL);
	}
	*ps++ = c;
    } while (c != '\n');
    *--ps = 0;
    return(buffer);
}

char *
fgets(buffer, maxbyt, fp)
char *buffer;
int maxbyt;
FILE *fp;
{
    int i;
    char *ps;
    int c;

    ps = buffer;
    for (i = 0; i < maxbyt; i++) {
	if ((c = getc(fp)) == EOF) {
	    return(NULL);
	}
	*ps++ = c;
	if (c == '\n') {
	    *ps = 0;
	    break;
	}
    }
    return(buffer);
}
