Fixed maxsize problem in string constructor.

git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@381 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
Dave Beazley 2000-04-05 02:46:27 +00:00
commit f07a08e5c9

View file

@ -136,13 +136,13 @@ String::String() {
// ---------------------------------------------------------------
String::String(const char *s) {
int max = INIT_MAXSIZE;
maxsize = INIT_MAXSIZE;
int l = 0;
if (s) {
l = (int) strlen(s);
if ((l+1) > max) max = l+1;
if ((l+1) > maxsize) maxsize = l+1;
}
str = new char[max];
str = new char[maxsize];
if (s) {
strcpy(str,s);
len = l;