$NetBSD: patch-ad,v 1.8 1999/10/28 02:40:24 hubertf Exp $ --- sdr/src/sd_listen.c.orig Fri Jul 16 15:07:27 1999 +++ sdr/src/sd_listen.c Sat Oct 2 20:42:45 1999 @@ -55,6 +55,9 @@ #include #include #endif +#ifdef HAVE_SYS_INTTYPES_H +#include +#endif #include #include #include @@ -515,10 +518,18 @@ /* set p to point to line following "n=....\nk=...\n" */ if (strncmp(k1, "k=", 2)==0) { +#ifdef HAVE_SYS_INTTYPES_H + if ((uintptr_t)k2>=(uintptr_t)k1+2) { + memcpy(key, k1+2, (uintptr_t)k2-((uintptr_t)k1+1)); + key[(uintptr_t)k2-((uintptr_t)k1+1)]='\0'; + } +#else if ((u_int)k2>=(u_int)k1+2) { memcpy(key, k1+2, (u_int)k2-((u_int)k1+1)); key[(u_int)k2-((u_int)k1+1)]='\0'; - } else { + } +#endif + else { key[0]='\0'; } p=strchr(k1, '\n')+1; @@ -1383,7 +1394,11 @@ if (cli) { init_cli(); inChannel = fileno(stdin); +#ifdef HAVE_SYS_INTTYPES_H + Tcl_CreateFileHandler(inChannel, TCL_READABLE, (Tcl_FileProc*)do_cli, (ClientData)(intptr_t) inChannel); +#else Tcl_CreateFileHandler(inChannel, TCL_READABLE, (Tcl_FileProc*)do_cli, (ClientData) inChannel); +#endif } #endif @@ -1507,7 +1522,11 @@ unsigned long src, hfrom; unsigned long endtime; +#ifdef HAVE_SYS_INTTYPES_H + intptr_t ix = rfd2sock[PTOI(fd)]; +#else int ix = rfd2sock[PTOI(fd)]; +#endif writelog(printf("entered recv_packets\n");)