summaryrefslogtreecommitdiff
path: root/net/netatalk/patches/patch-ab
blob: 8296330b9152d0a586f6c3e09c63fcafc560b7e5 (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
$NetBSD: patch-ab,v 1.11 2006/06/05 17:23:38 joerg Exp $

--- bin/psorder/psorder.c.orig	2006-06-05 16:54:26.000000000 +0000
+++ bin/psorder/psorder.c
@@ -35,6 +35,7 @@
 #include <sys/uio.h>
 #include <sys/file.h>
 #include <ctype.h>
+#include <limits.h>
 #ifdef HAVE_FCNTL_H
 #include <fcntl.h>
 #endif /* HAVE_FCNTL_H */
@@ -102,7 +103,11 @@ psorder( path )
 {
     int			tempfd;
     int			inputfd;
+#if defined(NAME_MAX)
+    char		tempfile[NAME_MAX];
+#else
     char		tempfile[MAXNAMLEN];
+#endif
 
     filesetup( path, &inputfd, tempfile, &tempfd );
     readps( inputfd, tempfd, tempfile );
@@ -151,7 +156,11 @@ filesetup( inputfile, infd, tfile, tfd )
 	make temporary file
  */
 
+#if defined(NAME_MAX)
+    (void *)strncpy( tfile, template, NAME_MAX );
+#else
     (void *)strncpy( tfile, template, MAXNAMLEN );
+#endif
     if (( *tfd = mkstemp( tfile )) == -1 ) {
 	fprintf( stderr, "can't create temporary file %s\n", tfile );
 	filecleanup( -1, -1, "" );