Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Fix endless loop since grandparent commit
  • Loading branch information
est31 committed Jul 4, 2015
1 parent c53520a commit 64dc053
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions src/craftdef.cpp
Expand Up @@ -242,12 +242,13 @@ static std::string craftDumpMatrix(const std::vector<std::string> &items,
{
std::ostringstream os(std::ios::binary);
os << "{ ";
unsigned int x = 0;
for(std::vector<std::string>::size_type i = 0;
i < items.size(); i++) {
if (i == width) {
i < items.size(); i++, x++) {
if (x == width) {
os << "; ";
i = 0;
} else if (i != 0) {
x = 0;
} else if (x != 0) {
os << ",";
}
os << '"' << items[i] << '"';
Expand All @@ -262,12 +263,13 @@ std::string craftDumpMatrix(const std::vector<ItemStack> &items,
{
std::ostringstream os(std::ios::binary);
os << "{ ";
unsigned int x = 0;
for (std::vector<ItemStack>::size_type i = 0;
i < items.size(); i++) {
if (i == width) {
i < items.size(); i++, x++) {
if (x == width) {
os << "; ";
i = 0;
} else if (i != 0) {
x = 0;
} else if (x != 0) {
os << ",";
}
os << '"' << (items[i].getItemString()) << '"';
Expand Down

0 comments on commit 64dc053

Please sign in to comment.