|
From: Lasse Kärkkäi. <tr...@us...> - 2011-07-06 23:37:30
|
Author: Lasse Karkkainen <tro...@tr...>
Date: Tue Jun 28 00:27:17 2011 +0300
Someone used 1-based array indices but in C they begin at zero. Needs
testing.
---
tools/pak.cpp | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/tools/pak.cpp b/tools/pak.cpp
index 6d1c79b..198577c 100644
--- a/tools/pak.cpp
+++ b/tools/pak.cpp
@@ -64,8 +64,8 @@ Pak::Pak(std::string const& filename) {
name += std::string(tmp, string_length - 1);
unsigned ext_idx = readLE<1>(f);
char toto[2];
- toto[1] = '0' + ext.size();
- toto[2] = '\0';
+ toto[0] = '0' + ext.size();
+ toto[1] = '\0';
if (ext_idx) name += std::string(".") + (ext_idx <= ext.size() ? ext[ext_idx-1] : std::string(toto));
std::replace(name.begin(), name.end(), '\\', '/');
m_files.insert(std::make_pair(name, file));
|