summaryrefslogtreecommitdiffstats
path: root/src/bltParse.C
diff options
context:
space:
mode:
authorjoye <joye>2014-03-17 14:43:29 (GMT)
committerjoye <joye>2014-03-17 14:43:29 (GMT)
commit2502655cf696ac6b78ade1376845f3726e6179d6 (patch)
tree05ce2df952a79ce14be6a82c3f6c224b3f715c71 /src/bltParse.C
parent1ca1642ae4c8db4b77c0247e3a8e86f87b58254e (diff)
downloadblt-2502655cf696ac6b78ade1376845f3726e6179d6.zip
blt-2502655cf696ac6b78ade1376845f3726e6179d6.tar.gz
blt-2502655cf696ac6b78ade1376845f3726e6179d6.tar.bz2
*** empty log message ***
Diffstat (limited to 'src/bltParse.C')
-rw-r--r--src/bltParse.C15
1 files changed, 7 insertions, 8 deletions
diff --git a/src/bltParse.C b/src/bltParse.C
index a2fa375..930a2b1 100644
--- a/src/bltParse.C
+++ b/src/bltParse.C
@@ -23,8 +23,10 @@
* since the compiled code typically runs only one time.
*/
+extern "C" {
#include "bltInt.h"
#include "bltParse.h"
+};
/*
* A table used to classify input characters to assist in parsing
@@ -358,20 +360,17 @@ void Blt_ExpandParseValue(
int needed) /* Minimum amount of additional space
* to allocate. */
{
- int size;
- char *buffer;
-
/*
* Either double the size of the buffer or add enough new space
* to meet the demand, whichever produces a larger new buffer.
*/
- size = (parsePtr->end - parsePtr->buffer) + 1;
- if (size < needed) {
+ int size = (parsePtr->end - parsePtr->buffer) + 1;
+ if (size < needed)
size += needed;
- } else {
+ else
size += size;
- }
- buffer = malloc((unsigned int)size);
+
+ char* buffer = (char*)malloc((unsigned int)size);
/*
* Copy from old buffer to new, free old buffer if needed, and