Browse Source

Merge pull request #268 from TheBlueMatt/deletefix

Fixes #240 and #244 - delete delete[] mismatch.
miguelfreitas
Jeff Garzik 14 years ago
parent
commit
20d28e6031
  1. 4
      src/util.cpp

4
src/util.cpp

@ -271,7 +271,7 @@ string strprintf(const char* format, ...) @@ -271,7 +271,7 @@ string strprintf(const char* format, ...)
if (ret >= 0 && ret < limit)
break;
if (p != buffer)
delete p;
delete[] p;
limit *= 2;
p = new char[limit];
if (p == NULL)
@ -279,7 +279,7 @@ string strprintf(const char* format, ...) @@ -279,7 +279,7 @@ string strprintf(const char* format, ...)
}
string str(p, p+ret);
if (p != buffer)
delete p;
delete[] p;
return str;
}

Loading…
Cancel
Save