summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/libexec/httpd.c2
-rw-r--r--src/libexec/peerip.c10
2 files changed, 8 insertions, 4 deletions
diff --git a/src/libexec/httpd.c b/src/libexec/httpd.c
index cd44446..22d9b2b 100644
--- a/src/libexec/httpd.c
+++ b/src/libexec/httpd.c
@@ -87,7 +87,7 @@ int main(int argc,char *argv[]) {
printf("HTTP/1.1 500 Internal Server Error\r\n");
standard_headers();
printf("Content-type: text/html\r\n\r\ncouldn't chdir(\"%s\");",SITES_ROOT);
- //wtf? not sites dir???
+ //wtf? no sites dir???
exit(2);
}
}
diff --git a/src/libexec/peerip.c b/src/libexec/peerip.c
index d35aca7..9298f87 100644
--- a/src/libexec/peerip.c
+++ b/src/libexec/peerip.c
@@ -6,8 +6,12 @@ int main(int argc,char *argv[]) {
int i;
struct sockaddr sa;
int sl=sizeof(sa);
- char host[256];
+ char h[NI_MAXHOST], s[NI_MAXSERV];
getpeername(0,&sa,&sl);
- getnameinfo(&sa,sl,host,256,0,0,NI_NUMERICHOST);
- puts(host);
+ if(getnameinfo(&sa,sl,h,sizeof(h),s,sizeof(s),NI_NUMERICHOST|NI_NUMERICSERV)) {
+ return 1;
+ }
+ puts(h);
+ puts(s);
+ return 0;
}