Fixed CString bug

This commit is contained in:
David Anderson 2004-06-30 03:21:14 +00:00
parent 5ea3af0b2b
commit 7083c898f0

View File

@ -32,7 +32,8 @@ public:
return; return;
} }
Grow(strlen(d)); Grow(strlen(d));
strcpy(v, d); if (v)
strcpy(v, d);
} }
void clear() void clear()
@ -70,6 +71,8 @@ public:
private: private:
void Grow(int d) void Grow(int d)
{ {
if (d<1)
return;
if (d > mSize) if (d > mSize)
{ {
char *t = new char[d+1]; char *t = new char[d+1];