ref: 2a2ce58b4cdf7c144b14fcffd4d0a07a5f3b75f2
parent: f13b902be9a8a91099653e11da61969ea69db3e8
author: Diego Biurrun <diego@biurrun.de>
date: Fri Oct 31 10:49:05 EDT 2014
Replace sizeof(type) by sizeof(*variable).
--- a/src/css.c
+++ b/src/css.c
@@ -205,7 +205,7 @@
&& p_title->i_startlb == i_block )
{
/* We've already cracked this key, nothing to do */
- memcpy( dvdcss->css.p_title_key, p_title->p_key, sizeof(dvd_key_t) );
+ memcpy( dvdcss->css.p_title_key, p_title->p_key, sizeof(*p_title->p_key) );
return 0;
}
@@ -296,7 +296,7 @@
p_title = p_newtitle;
/* Write in the new title and its key */
- p_newtitle = malloc( sizeof( dvd_title_t ) );
+ p_newtitle = malloc( sizeof( *p_newtitle ) );
if( p_newtitle == NULL )
{
return -1;
@@ -1086,7 +1086,7 @@
unsigned int i, n = 0;
/* Decrypt disc key with the above player keys */
- for( n = 0; n < sizeof(player_keys) / sizeof(dvd_key_t); n++ )
+ for( n = 0; n < sizeof(player_keys) / sizeof(*player_keys); n++ )
{
PrintKey( dvdcss, "trying player key ", player_keys[n] );
@@ -1205,7 +1205,7 @@
}
/* Initializing our really big table */
- BigTable = calloc( 16777216, sizeof(int) );
+ BigTable = calloc( 16777216, sizeof(*BigTable) );
if( BigTable == NULL )
{
free( K1table );
--- a/src/libdvdcss.c
+++ b/src/libdvdcss.c
@@ -161,7 +161,7 @@
#endif
/* Allocate the library structure. */
- dvdcss_t dvdcss = malloc( sizeof( struct dvdcss_s ) );
+ dvdcss_t dvdcss = malloc( sizeof( *dvdcss ) );
if( dvdcss == NULL )
{
return NULL;