From f07a08e5c9b2fb715897e30dfe4fda49c96b99fc Mon Sep 17 00:00:00 2001 From: Dave Beazley Date: Wed, 5 Apr 2000 02:46:27 +0000 Subject: [PATCH] Fixed maxsize problem in string constructor. git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@381 626c5289-ae23-0410-ae9c-e8d60b6d4f22 --- SWIG/Source/SWIG1.1/sstring.cxx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/SWIG/Source/SWIG1.1/sstring.cxx b/SWIG/Source/SWIG1.1/sstring.cxx index b53ae49e6..d07f5faf7 100644 --- a/SWIG/Source/SWIG1.1/sstring.cxx +++ b/SWIG/Source/SWIG1.1/sstring.cxx @@ -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;