summaryrefslogtreecommitdiff
path: root/comms/minicom/patches/patch-ag
blob: 9318e102f46cfd80963d31474b8298d60a063dd9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
$NetBSD: patch-ag,v 1.4 2011/08/01 09:30:33 adam Exp $

--- src/getsdir.c.orig	2009-12-12 15:47:47.000000000 +0000
+++ src/getsdir.c
@@ -185,7 +185,11 @@ int getsdir(const char *dirpath, const c
           int l;
 
           /* copy the filename */
+#ifdef NAME_MAX
+          strncpy(datb_cur->data[datb_cur->cnt].fname, dp->d_name, NAME_MAX);
+#else
           strncpy(datb_cur->data[datb_cur->cnt].fname, dp->d_name, MAXNAMLEN);
+#endif
 
           /* get information about the directory entry */
           snprintf(fpath, sizeof(fpath), "%s/%s", dirpath, dp->d_name);