<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
</head>
<body dir="ltr" bgcolor="#ffffff" text="#000000">
Today was the second time that I ran across this problem. Each time I
run across it, I search Google, come back empty handed, and then have a
second look, find the solution, and altogether waste too much time on a
problem I have solved before. As a measure to prevent this, I am
posting both problem and solution to this mailing list, that has a high
Google juice, so that the next time, I will find my own solution.<br>
<br>
In other words, I am shamelessly using the list to archive my problems
and solutions.<br>
<br>
The problem:<br>
The following code segfaults:<br>
printf("%s\n", inet_ntoa(addr) );<br>
<br>
The cause: Failing to include the relevant header file.<br>
<br>
The solution: Add:<br>
#include <arpa/inet.h><br>
<br>
Sorry for the noise.<br>
Shachar<br>
<pre class="moz-signature" cols="72">--
Shachar Shemesh
Lingnu Open Source Consulting Ltd.
<a class="moz-txt-link-freetext" href="http://www.lingnu.com">http://www.lingnu.com</a>
</pre>
</body>
</html>