Permalink
Browse files

GetFileContents now clears the memory before use, just to be a tad mo…

…re paranoid.
  • Loading branch information...
1 parent 4f457cf commit 92630440d27c63e10486a101bb3a372e8bf9c20b @uliwitness committed Jan 4, 2011
Showing with 1 addition and 1 deletion.
  1. +1 −1 GetFileContents.c
View
@@ -44,7 +44,7 @@ char* GetFileContents( const char* fname )
fseek( theFile, 0, SEEK_END );
int len = ftell( theFile ),
readbytes;
- char* codeStr = (char*) malloc( len +1 );
+ char* codeStr = (char*) calloc( len +1, sizeof(char) );
// Rewind and read in whole file:
fseek( theFile, 0, SEEK_SET );

0 comments on commit 9263044

Please sign in to comment.