#include <stdio.h>

/*
 * fgetss (buf, len, stream)
 *
 *	Like fgets but strips trailing newline
 */

extern unsigned char
    *fgets ();

fgetss (buf, buflen, fd)
unsigned char *buf;
unsigned int buflen;
FILE *fd;
{
int
    len;

unsigned int
    addr;

if (addr = fgets (buf, buflen, fd))
    {
    len = strlen (buf) - 1;
    if (len > 0 && buf[len] == '\n')
	buf[len] = '\0';
    };
return (addr);
}
