getservbyport (fwd)

Bartlomiej Czardybon (czar@dumb.iinf.polsl.gliwice.pl)
Tue, 14 May 1996 02:28:04 +0200 (MET DST)


I've got the question: why this produces shit! ?

#include <stdio.h>
#include <netdb.h>

main() {
struct servent *serv;
if ((serv = getservbyport(23, "tcp")) == NULL) {
printf("shit!\n");
} else {
printf("name: %s\n", serv->s_name);
}
}

Bartlomiej Czardybon
Silesian Technical University - Faculty of Computer Science