summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2017-03-16 07:44:38 +0100
committerSebastian Huber <sebastian.huber@embedded-brains.de>2017-03-21 16:15:11 +0100
commit7011f260617859384379cb9a351eb49983a4b7d1 (patch)
tree2411a71b5f770ad9b12878a58b0621c441013187
parent49eb6061ec01f5ae0208b487f97ccb6dab910313 (diff)
dosfs: Fix long file name padding
Close #2934.
-rw-r--r--cpukit/libfs/src/dosfs/msdos_misc.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/cpukit/libfs/src/dosfs/msdos_misc.c b/cpukit/libfs/src/dosfs/msdos_misc.c
index 321d1be656..3ea462d017 100644
--- a/cpukit/libfs/src/dosfs/msdos_misc.c
+++ b/cpukit/libfs/src/dosfs/msdos_misc.c
@@ -1760,10 +1760,11 @@ msdos_add_file (
#endif
for (i = 0; i < MSDOS_LFN_LEN_PER_ENTRY; ++i)
{
- if (!(*n == 0 && *(n+1) == 0))
+ if (*n != 0 || *(n + 1) != 0)
{
*p = *n;
- *(p+1) = *(n+1);
+ *(p + 1) = *(n + 1);
+ n += MSDOS_NAME_LFN_BYTES_PER_CHAR;
}
else
{
@@ -1771,7 +1772,6 @@ msdos_add_file (
p [1] = fill;
fill = 0xff;
}
- n += MSDOS_NAME_LFN_BYTES_PER_CHAR;
#if MSDOS_FIND_PRINT
printf ( "'%c''%c'", *p, *(p+1) );
#endif