makeTmpString
Signed-off-by: James Cherry <cherry@parallaxsw.com>
This commit is contained in:
parent
fba5a77d26
commit
3166392242
|
|
@ -20,12 +20,15 @@
|
||||||
#include <cctype>
|
#include <cctype>
|
||||||
#include <cstdio>
|
#include <cstdio>
|
||||||
#include <array>
|
#include <array>
|
||||||
|
#include <algorithm>
|
||||||
|
|
||||||
#include "Machine.hh"
|
#include "Machine.hh"
|
||||||
#include "Mutex.hh"
|
#include "Mutex.hh"
|
||||||
|
|
||||||
namespace sta {
|
namespace sta {
|
||||||
|
|
||||||
|
using std::max;
|
||||||
|
|
||||||
static void
|
static void
|
||||||
stringPrintTmp(const char *fmt,
|
stringPrintTmp(const char *fmt,
|
||||||
va_list args,
|
va_list args,
|
||||||
|
|
@ -199,9 +202,10 @@ makeTmpString(size_t length)
|
||||||
if (tmp_length < length) {
|
if (tmp_length < length) {
|
||||||
// String isn't long enough. Make a new one.
|
// String isn't long enough. Make a new one.
|
||||||
delete [] tmp_str;
|
delete [] tmp_str;
|
||||||
tmp_str = new char[length];
|
tmp_length = max(tmp_string_initial_length, length);
|
||||||
|
tmp_str = new char[tmp_length];
|
||||||
tmp_strings[tmp_string_next] = tmp_str;
|
tmp_strings[tmp_string_next] = tmp_str;
|
||||||
tmp_string_lengths[tmp_string_next] = length;
|
tmp_string_lengths[tmp_string_next] = tmp_length;
|
||||||
}
|
}
|
||||||
tmp_string_next++;
|
tmp_string_next++;
|
||||||
return tmp_str;
|
return tmp_str;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue