Index: uspace/srv/fs/fat/fat_dentry.c
===================================================================
--- uspace/srv/fs/fat/fat_dentry.c	(revision 9fbe05efa56d422a4015adee3c513bf299609cce)
+++ uspace/srv/fs/fat/fat_dentry.c	(revision 842a2d27f4f0102a5ee40d6b3a27c77c9de90501)
@@ -269,5 +269,5 @@
 {
 	int i;
-	for (i=1; i>=0 && *offset>0; i--) {
+	for (i=FAT_LFN_PART3_SIZE-1; i>=0 && *offset>0; i--) {
 		if (d->lfn.part3[i] == 0 || d->lfn.part3[i] == FAT_LFN_PAD)
 			continue;
@@ -275,5 +275,5 @@
 		dst[(*offset)] = uint16_t_le2host(d->lfn.part3[i]);
 	}
-	for (i=5; i>=0 && *offset>0; i--) {
+	for (i=FAT_LFN_PART2_SIZE-1; i>=0 && *offset>0; i--) {
 		if (d->lfn.part2[i] == 0 || d->lfn.part2[i] == FAT_LFN_PAD)
 			continue;
@@ -281,5 +281,5 @@
 		dst[(*offset)] = uint16_t_le2host(d->lfn.part2[i]);
 	}
-	for (i=4; i>=0 && *offset>0; i--) {
+	for (i=FAT_LFN_PART1_SIZE-1; i>=0 && *offset>0; i--) {
 		if (d->lfn.part1[i] == 0 || d->lfn.part1[i] == FAT_LFN_PAD)
 			continue;
@@ -293,5 +293,5 @@
 {
 	size_t idx;
-	for (idx=0; idx < 5; idx++) {
+	for (idx=0; idx < FAT_LFN_PART1_SIZE; idx++) {
 		if (*offset < size) {
 			d->lfn.part1[idx] = host2uint16_t_le(src[*offset]);
@@ -301,5 +301,5 @@
 			d->lfn.part1[idx] = FAT_LFN_PAD;
 	}
-	for (idx=0; idx < 6; idx++) {
+	for (idx=0; idx < FAT_LFN_PART2_SIZE; idx++) {
 		if (*offset < size) {
 			d->lfn.part2[idx] = host2uint16_t_le(src[*offset]);
@@ -309,5 +309,5 @@
 			d->lfn.part2[idx] = FAT_LFN_PAD;
 	}
-	for (idx=0; idx < 2; idx++) {
+	for (idx=0; idx < FAT_LFN_PART3_SIZE; idx++) {
 		if (*offset < size) {
 			d->lfn.part3[idx] = host2uint16_t_le(src[*offset]);
