summaryrefslogtreecommitdiff
path: root/Source/Library/Common/ByteArray.class.cpp
diff options
context:
space:
mode:
authorAlexis211 <alexis211@gmail.com>2009-11-24 13:00:34 +0100
committerAlexis211 <alexis211@gmail.com>2009-11-24 13:00:34 +0100
commit0f536540de15202d44cd9b1d708ee04edccb8c66 (patch)
treec57c850f6ad62f444235c3c28c79165ba7a0b10e /Source/Library/Common/ByteArray.class.cpp
parent3833a92d5823f0f54030dedbcadbda4ef8583b41 (diff)
downloadMelon-0f536540de15202d44cd9b1d708ee04edccb8c66.tar.gz
Melon-0f536540de15202d44cd9b1d708ee04edccb8c66.zip
Multiple things :
- Partially fixed FATFS::read - Corrected some unicode encoding/decoding related stuff - Implemented LFN entries parsing
Diffstat (limited to 'Source/Library/Common/ByteArray.class.cpp')
-rw-r--r--Source/Library/Common/ByteArray.class.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/Source/Library/Common/ByteArray.class.cpp b/Source/Library/Common/ByteArray.class.cpp
index 2a42702..95326f7 100644
--- a/Source/Library/Common/ByteArray.class.cpp
+++ b/Source/Library/Common/ByteArray.class.cpp
@@ -50,9 +50,9 @@ void ByteArray::resize(u32int size) {
}
String ByteArray::toString (u8int encoding) {
- char* c = new char[m_length + 1];
+ char* c = new char[m_length + 4];
memcpy((u8int*)c, m_string, m_length);
- c[m_length] = 0; //Add NULL terminator
+ for (int i = 0; i < 4; i++) c[m_length + i] = 0; //Add NULL terminator
String r(c, encoding);
delete c;
return r;