File tree Expand file tree Collapse file tree 1 file changed +14
-14
lines changed
Expand file tree Collapse file tree 1 file changed +14
-14
lines changed Original file line number Diff line number Diff line change @@ -1815,26 +1815,26 @@ static int
18151815CompressClipData (Bytef * dest , uLongf * destLen , Bytef * source , uLong sourceLen )
18161816{
18171817 int ret ;
1818- z_stream * zs = ( z_stream * ) malloc ( sizeof ( z_stream )) ;
1819- memset (zs , 0 , sizeof (z_stream ));
1818+ z_stream zs ;
1819+ memset (& zs , 0 , sizeof (z_stream ));
18201820
1821- zs -> zfree = Z_NULL ;
1822- zs -> zalloc = Z_NULL ;
1823- zs -> opaque = Z_NULL ;
1824- ret = deflateInit (zs , Z_DEFAULT_COMPRESSION );
1821+ zs . zfree = Z_NULL ;
1822+ zs . zalloc = Z_NULL ;
1823+ zs . opaque = Z_NULL ;
1824+ ret = deflateInit (& zs , Z_DEFAULT_COMPRESSION );
18251825 if (ret == Z_OK ) {
1826- zs -> avail_in = sourceLen ;
1827- zs -> next_in = source ;
1828- zs -> avail_out = * destLen ;
1829- zs -> next_out = dest ;
1826+ zs . avail_in = sourceLen ;
1827+ zs . next_in = source ;
1828+ zs . avail_out = * destLen ;
1829+ zs . next_out = dest ;
18301830
18311831 do {
18321832 // Using Z_SYNC_FLUSH instead of Z_FINISH is the key here.
1833- ret = deflate (zs , Z_SYNC_FLUSH );
1834- } while (ret >= 0 && zs -> avail_in > 0 );
1833+ ret = deflate (& zs , Z_SYNC_FLUSH );
1834+ } while (ret >= 0 && zs . avail_in > 0 );
18351835
1836- * destLen = zs -> total_out ;
1837- deflateEnd (zs );
1836+ * destLen = zs . total_out ;
1837+ deflateEnd (& zs );
18381838 }
18391839 return ret ;
18401840}
You can’t perform that action at this time.
0 commit comments