diff options
-rw-r--r-- | usr.sbin/makefs/cd9660.c | 4 | ||||
-rw-r--r-- | usr.sbin/makefs/cd9660.h | 2 | ||||
-rw-r--r-- | usr.sbin/makefs/cd9660/cd9660_write.c | 2 |
3 files changed, 3 insertions, 5 deletions
diff --git a/usr.sbin/makefs/cd9660.c b/usr.sbin/makefs/cd9660.c index 40b2488e99e5..4159e08c8210 100644 --- a/usr.sbin/makefs/cd9660.c +++ b/usr.sbin/makefs/cd9660.c @@ -1582,10 +1582,10 @@ cd9660_compute_full_filename(cd9660node *node, char *buf) { int len; - len = CD9660MAXPATH + 1; + len = PATH_MAX; len = snprintf(buf, len, "%s/%s/%s", node->node->root, node->node->path, node->node->name); - if (len > CD9660MAXPATH) + if (len >= PATH_MAX) errx(EXIT_FAILURE, "Pathname too long."); } diff --git a/usr.sbin/makefs/cd9660.h b/usr.sbin/makefs/cd9660.h index d854429a24bf..80b49f86ecf8 100644 --- a/usr.sbin/makefs/cd9660.h +++ b/usr.sbin/makefs/cd9660.h @@ -65,8 +65,6 @@ #define INODE_WARNX(__x) #endif /* DEBUG */ -#define CD9660MAXPATH 4096 - #define ISO_STRING_FILTER_NONE = 0x00 #define ISO_STRING_FILTER_DCHARS = 0x01 #define ISO_STRING_FILTER_ACHARS = 0x02 diff --git a/usr.sbin/makefs/cd9660/cd9660_write.c b/usr.sbin/makefs/cd9660/cd9660_write.c index c77ba2b5f198..6716c2f98704 100644 --- a/usr.sbin/makefs/cd9660/cd9660_write.c +++ b/usr.sbin/makefs/cd9660/cd9660_write.c @@ -273,7 +273,7 @@ cd9660_write_file(iso9660_disk *diskStructure, FILE *fd, cd9660node *writenode) /* Todo : clean up variables */ - temp_file_name = ecalloc(CD9660MAXPATH + 1, 1); + temp_file_name = ecalloc(PATH_MAX, 1); buf = emalloc(diskStructure->sectorSize); if ((writenode->level != 0) && !(writenode->node->type & S_IFDIR)) { |