summaryrefslogtreecommitdiffstats
path: root/src/base/cba
diff options
context:
space:
mode:
authorAlan Mishchenko <alanmi@berkeley.edu>2015-03-18 19:39:22 +0700
committerAlan Mishchenko <alanmi@berkeley.edu>2015-03-18 19:39:22 +0700
commitc602cbe33849e9365a3b8e3f13a13e696aa7b9ec (patch)
treee9b756ac631766e6e7c85dd7e2eb383c087e748c /src/base/cba
parentfb5d4a664dc3790e98036a94734a33a848fd3666 (diff)
downloadabc-c602cbe33849e9365a3b8e3f13a13e696aa7b9ec.tar.gz
abc-c602cbe33849e9365a3b8e3f13a13e696aa7b9ec.tar.bz2
abc-c602cbe33849e9365a3b8e3f13a13e696aa7b9ec.zip
Scalable SOP manipulation package.
Diffstat (limited to 'src/base/cba')
-rw-r--r--src/base/cba/cbaPrs.h9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/base/cba/cbaPrs.h b/src/base/cba/cbaPrs.h
index 76f7d060..9c7a1dfe 100644
--- a/src/base/cba/cbaPrs.h
+++ b/src/base/cba/cbaPrs.h
@@ -241,13 +241,14 @@ static inline char * Prs_ManLoadFile( char * pFileName, char ** ppLimit )
// move the file current reading position to the beginning
rewind( pFile );
// load the contents of the file into memory
- pBuffer = ABC_ALLOC( char, nFileSize + 3 );
+ pBuffer = ABC_ALLOC( char, nFileSize + 16 );
pBuffer[0] = '\n';
RetValue = fread( pBuffer+1, nFileSize, 1, pFile );
+ fclose( pFile );
// terminate the string with '\0'
- pBuffer[nFileSize + 0] = '\n';
- pBuffer[nFileSize + 1] = '\0';
- *ppLimit = pBuffer + nFileSize + 2;
+ pBuffer[nFileSize + 1] = '\n';
+ pBuffer[nFileSize + 2] = '\0';
+ *ppLimit = pBuffer + nFileSize + 3;
return pBuffer;
}
static inline Prs_Man_t * Prs_ManAlloc( char * pFileName )