// -*- mode: cpp; mode: fold -*-
// Description /*{{{*/
-// $Id: rfc2553emu.cc,v 1.2 1999/05/26 04:08:39 jgg Exp $
+// $Id: rfc2553emu.cc,v 1.6 1999/12/11 02:11:10 jgg Exp $
/* ######################################################################
RFC 2553 Emulation - Provides emulation for RFC 2553 getaddrinfo,
freeaddrinfo and getnameinfo
+
+ This is really C code, it just has a .cc extensions to play nicer with
+ the rest of APT.
Originally written by Jason Gunthorpe <jgg@debian.org> and placed into
the Public Domain, do with it what you will.
-
+
##################################################################### */
/*}}}*/
#include "rfc2553emu.h"
#include <stdlib.h>
#include <arpa/inet.h>
+#include <netinet/in.h>
#include <string.h>
#include <stdio.h>
const struct addrinfo *hints,
struct addrinfo **res)
{
- struct addrinfo **Result;
+ struct addrinfo **Result = res;
hostent *Addr;
unsigned int Port;
int Proto;
Proto = hints->ai_socktype;
// Not a number, must be a name.
- if (End != servname + strlen(End))
+ if (End != servname + strlen(servname))
{
struct servent *Srv = 0;
{
struct sockaddr_in *sin = (struct sockaddr_in *)sa;
- // This routine only support internet addresses
+ // This routine only supports internet addresses
if (sa->sa_family != AF_INET)
return EAI_ADDRFAMILY;