summaryrefslogtreecommitdiff
path: root/archivers/arc/patches/patch-ac
blob: 6ed600c270717a02449eb2be3032dbe2ff5bd554 (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
$NetBSD: patch-ac,v 1.1 2005/01/01 11:43:27 kristerw Exp $

--- arcmisc.c.orig	Wed Apr 15 00:59:12 1992
+++ arcmisc.c	Sat Jan  1 12:36:08 2005
@@ -5,6 +5,7 @@
 
 #include <stdio.h>
 #include <ctype.h>
+#include <unistd.h>
 #include "arc.h"
 
 #include <string.h>
@@ -233,16 +234,16 @@
 	char           *dirname;
 
 {
-	char           *getwd();
+	size_t		buf_size = 0;
 #if	GEMDOS
 	int             drv;
 	char           *buf;
 #endif
-	if (dirname == NULL || strlen(dirname) == 0)
-		dirname = (char *) malloc(1024);
+	if (dirname == NULL || (buf_size = strlen(dirname)) == 0)
+		dirname = (char *) malloc(buf_size = 1024);
 
 #if	!GEMDOS
-	getwd(dirname);
+	getcwd(dirname, buf_size);
 #else
 	buf = dirname;
 	*buf++ = (drv = Dgetdrv()) + 'A';