summaryrefslogtreecommitdiffstats
path: root/cpukit
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2017-03-14 13:59:09 +0100
committerSebastian Huber <sebastian.huber@embedded-brains.de>2017-03-21 16:14:37 +0100
commit21d7154b07a873476a9ad5899e1db9729d4eb410 (patch)
treec456bf42f26f023003cf722ea7e5b8b559a57c5e /cpukit
parentlibio: Fix deadlock in location management (diff)
downloadrtems-21d7154b07a873476a9ad5899e1db9729d4eb410.tar.bz2
dosfs: Fix msdos_utf8_normalize_and_fold()
It is all right in case the result uses the full destination buffer. Without this fix the handling of a maximum 8.3 short file name is broken. Close #2928.
Diffstat (limited to 'cpukit')
-rw-r--r--cpukit/libfs/src/dosfs/msdos_conv_utf8.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/cpukit/libfs/src/dosfs/msdos_conv_utf8.c b/cpukit/libfs/src/dosfs/msdos_conv_utf8.c
index ddf2fdbaa7..cc5c0271a7 100644
--- a/cpukit/libfs/src/dosfs/msdos_conv_utf8.c
+++ b/cpukit/libfs/src/dosfs/msdos_conv_utf8.c
@@ -222,10 +222,10 @@ static int msdos_utf8_normalize_and_fold(
);
if ( result >= 0 ) {
- if ( result < unicode_buf_size ) {
+ if ( result <= unicode_buf_size ) {
unicodes_to_reencode = result;
} else {
- unicodes_to_reencode = unicode_buf_size - 1;
+ unicodes_to_reencode = unicode_buf_size;
eno = ENOMEM;
}