TIP: Click on subject to list as thread! ANSI
echo: os2prog
to: Keith Bennett
from: Arjen Lentz
date: 1994-10-01 20:17:12
subject: TCP/IP gethostbyname() dangerous?

Hi Keith,

 KB> This question is about the gethostbyname() TCPIP function call.
 KB> According to the online documentation,
 KB> The return value points to static data that later calls overwrite.

So you copy the returned data instead of continuing to use the returned
pointer. Then you can do with it what you like....
There are more such functions, for instance localtime().
Cya! Agl.

---

* Origin: AINEX-BBS ZYX/FAX+31-33-633916 ISDN+31-33-614657 (FidoNet 2:283/512)
SEEN-BY: 12/2442 54/54 620/243 624/50 632/348 640/820 690/660 711/409 410 413
SEEN-BY: 711/430 807 808 809 934 942 712/353 623 713/888 800/1
@PATH: 283/512 280/801 24/24 396/1 3615/50 229/2 12/2442 711/409 54/54
@PATH: 711/808 809 934

SOURCE: echomail via fidonet.ozzmosis.com

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.