$NetBSD: patch-ag,v 1.6 2010/07/11 02:53:25 obache Exp $ --- Wnn/jlib/js.c.orig 1999-05-17 03:04:45.000000000 +0000 +++ Wnn/jlib/js.c @@ -70,9 +70,8 @@ extern Variables */ -extern char *malloc(); - #include +#include #include #ifdef UX386 #include @@ -85,7 +84,6 @@ extern char *malloc(); #endif #include #include -extern int errno; #include #include "jd_sock.h" #include "commonhd.h" @@ -103,8 +101,6 @@ extern int errno; #include "../etc/bdic.c" #include "../etc/pwd.c" -char *malloc(); - #ifdef SYSVR2 #define bzero(adr,n) memset((adr),0,(n)) #endif @@ -220,11 +216,11 @@ register char *lang; #endif return -1; } -#if !(defined(BSD) && (BSD >= 199306)) /* !4.4BSD-Lite */ - if (connect(sd,(struct sockaddr *)&saddr,strlen(saddr.sun_path)+sizeof(saddr.sun_family)) == ERROR) { -#else /* 4.4BSD-Lite */ + +#if !defined(SUN_LEN) +# define SUN_LEN(su) (sizeof(*(su)) - sizeof((su)->sun_path) + strlen((su)->sun_path)) +#endif if (connect(sd,(struct sockaddr *)&saddr,SUN_LEN(&saddr)) == ERROR) { -#endif /* 4.4BSD-Lite */ #if DEBUG xerror("jslib:Can't connect socket.\n"); @@ -2554,7 +2550,7 @@ char *lang; int cnt; { FILE *fp; - static char s[6][EXPAND_PATH_LENGTH]; + static char s[7][EXPAND_PATH_LENGTH]; char serv_defs[EXPAND_PATH_LENGTH]; char data[1024]; int num;