$NetBSD: patch-ab,v 1.6 2003/02/28 23:44:38 grant Exp $ --- vdcomp.c.orig Sat Mar 1 10:42:12 2003 +++ vdcomp.c @@ -109,12 +109,16 @@ !defined(__bsd43) && \ !defined(aux) && \ !defined(__bsdi__) && \ - !defined(sequent) + !defined(sequent) && \ + !defined(__FreeBSD__) && \ + !defined(__NetBSD__) && \ + !defined(__DARWIN__) # if defined(hp300) || defined(hp800) || defined(NeXT) # include /* it's in 'sys' on HPs and NeXT */ # else -# if !defined(__386BSD__) && !defined(__FreeBSD__) && !defined(__NetBSD__) +# if !defined(__386BSD__) && !defined(__FreeBSD__) && !defined(__NetBSD__) \ + && !defined(__Darwin__) /* I want to use BSD macro for checking if this OS is *BSD or not, but the macro is defined in , which I don't know all @@ -437,10 +441,13 @@ int host; { short shortint; typedef long off_t; + char *s; if (inname[0] == ' ') { printf("\nEnter name of file to be decompressed: "); - gets (inname); + fgets (inname, sizeof(inname), stdin); + if ((s = strchr(inname, '\n')) != NULL) + *s = '\0'; } if (host == 1 | host == 2) { @@ -482,13 +489,17 @@ int host; printf("\n 3. VICAR format."); printf("\n 4. Unlabelled binary array.\n"); printf("\n Enter format number:"); - gets(inname); + fgets (inname, sizeof(inname), stdin); + if ((s = strchr(inname, '\n')) != NULL) + *s = '\0'; output_format = atoi(inname); } while (output_format < 1 || output_format > 4); if (outname[0] == ' ') { printf("\nEnter name of uncompressed output file: "); - gets (outname); + fgets (outname, sizeof(outname), stdin); + if ((s = strchr(outname, '\n')) != NULL) + *s = '\0'; } return(host);