File tree Expand file tree Collapse file tree 1 file changed +4
-7
lines changed
Expand file tree Collapse file tree 1 file changed +4
-7
lines changed Original file line number Diff line number Diff line change @@ -90,7 +90,7 @@ - (id)initWithFile:(void *)theFile fromPath:(const char *)path mode:(int)mode
9090 if (fileMode == O_RDONLY) {
9191
9292 int i, c;
93- char * bzbuf = malloc ( 4 ) ;
93+ char bzbuf[ 4 ] ;
9494 const char *charFileMode = fileMode == O_WRONLY ? " wb" : " rb" ;
9595
9696 BZFILE *bzfile;
@@ -112,12 +112,9 @@ - (id)initWithFile:(void *)theFile fromPath:(const char *)path mode:(int)mode
112112 // indicate the Bzip version. Finally, the 4th byte should be a number between 1 and 9 that indicates
113113 // the block size used.
114114
115- BOOL isBzip2 = (sizeof (bzbuf) == 4 ) &&
116- ((bzbuf[0 ] == ' B' ) && (bzbuf[1 ] == ' Z' ) &&
117- ((bzbuf[2 ] == ' h' ) || (bzbuf[2 ] == ' 0' )) &&
118- ((bzbuf[3 ] >= 0x31 ) && (bzbuf[3 ] <= 0x39 )));
119-
120- free (bzbuf);
115+ BOOL isBzip2 = ((bzbuf[0 ] == ' B' ) && (bzbuf[1 ] == ' Z' )) &&
116+ ((bzbuf[2 ] == ' h' ) || (bzbuf[2 ] == ' 0' )) &&
117+ ((bzbuf[3 ] >= 0x31 ) && (bzbuf[3 ] <= 0x39 ));
121118
122119 if (isBzip2) bzfile = BZ2_bzopen (path, charFileMode);
123120
You can’t perform that action at this time.
0 commit comments