pkgsrc/sysutils/mtools/patches/patch-ai
is 2e366d259b Fix fencepost error when the filename length is N*13 characters.
Contributed by Michael Eriksson in PR 25439; reviewed by Joerg
Sonnenberger.
2006-10-13 13:04:31 +00:00

13 lines
450 B
Text

$NetBSD: patch-ai,v 1.1 2006/10/13 13:04:31 is Exp $
--- vfat.c.orig 2005-02-13 15:40:17.000000000 +0100
+++ vfat.c
@@ -238,7 +238,7 @@ int write_vfat(Stream_t *Dir, char *shor
printf("Wrote checksum=%d for shortname %s.\n",
vse->sum,shortname);
#endif
- num_vses = strlen(longname)/VSE_NAMELEN + 1;
+ num_vses = (strlen(longname) + VSE_NAMELEN - 1)/VSE_NAMELEN;
for (vse_id = num_vses; vse_id; --vse_id) {
int end = 0;