summaryrefslogtreecommitdiff
path: root/graphics/xv/patches/patch-ab
blob: 2bc3a32cf0cd78e9e1f300462b404216c59c57ca (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
$NetBSD: patch-ab,v 1.4 1999/11/14 13:25:59 rh Exp $

--- vdcomp.c.orig	Sun Nov 14 13:54:56 1999
+++ vdcomp.c	Sun Nov 14 13:54:59 1999
@@ -109,7 +109,8 @@
      !defined(__bsd43)                   && \
      !defined(aux)                       && \
      !defined(__bsdi__)                  && \
-     !defined(sequent)
+     !defined(sequent)			 && \
+     !defined(__FreeBSD__) && !defined(__NetBSD__)
 
 #  if defined(hp300) || defined(hp800) || defined(NeXT)
 #   include <sys/malloc.h>                /* it's in 'sys' on HPs and NeXT */
@@ -437,10 +438,13 @@
 {
   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 +486,17 @@
       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);