summaryrefslogtreecommitdiff
path: root/archivers/lha/patches/patch-ab
blob: 25118b0eda5dca6790bf149ad9f054bf3ea7748c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
$NetBSD: patch-ab,v 1.4 1999/05/22 20:11:33 tv Exp $

--- src/lharc.c.orig	Fri Mar  8 01:09:06 1996
+++ src/lharc.c	Sat May 22 15:55:50 1999
@@ -318,7 +318,9 @@
 		cmd_filec = 0;
 		if ((xfilev = (char **) malloc(sizeof(char *) * xfilec)) == NULL)
 			fatal_error("Virtual memory exhausted\n");
-		while (gets(inpbuf)) {
+		while (fgets(inpbuf, sizeof(inpbuf), stdin)) {
+			if ((p = strchr(inpbuf, '\n')))
+				*p = '\0';
 			if (cmd_filec >= xfilec) {
 				xfilec += 256;
 				cmd_filev = (char **) realloc(xfilev,