pkgsrc/net/netatalk/patches/patch-ab

36 lines
971 B
Text

$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, "" );