home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC Shareware 1999 March
/
PCShareware-3-99.iso
/
IMPLE
/
DJGPP.RAR
/
DJGPP2
/
XLIB-SR0.ZIP
/
SRC
/
XLIBEMU
/
GETHOSTN.C
< prev
next >
Wrap
C/C++ Source or Header
|
1994-02-18
|
338b
|
18 lines
/* $Id: gethostn.c 1.1 1994/02/18 21:10:19 ulrich Exp $ */
/*
* gethostname() needed for XLib(emu).
*/
#include <string.h>
extern char *getenv (const char *);
int gethostname(char *buf, int size)
{
char *p = getenv ("HOST");
if (p == (char *) 0)
p = "noname";
strncpy (buf, p, size - 1);
buf[size - 1] = 0;
return 0;
}