[vlc-commits] fingerprinter: use partial/zero initialization

Alexandre Janniaux git at videolan.org
Mon Mar 30 09:46:10 CEST 2020


vlc | branch: master | Alexandre Janniaux <ajanni at videolabs.io> | Mon Mar 23 19:03:40 2020 +0100| [d81aceac1a500448e48041a338117b1a1a0c80bd] | committer: Alexandre Janniaux

fingerprinter: use partial/zero initialization

Using memset to zero a struct with pointers isn't guaranteed to set
those pointers to NULL and is less elegant than using partial
initialization.

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=d81aceac1a500448e48041a338117b1a1a0c80bd
---

 modules/misc/fingerprinter.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/modules/misc/fingerprinter.c b/modules/misc/fingerprinter.c
index c96c471eb3..7a6bfc847d 100644
--- a/modules/misc/fingerprinter.c
+++ b/modules/misc/fingerprinter.c
@@ -360,9 +360,8 @@ static void *Run( void *opaque )
             char *psz_uri = input_item_GetURI( p_data->p_item );
             if ( psz_uri != NULL )
             {
-                 acoustid_fingerprint_t acoustid_print;
+                 acoustid_fingerprint_t acoustid_print = {0};
 
-                 memset( &acoustid_print , 0, sizeof (acoustid_print) );
                 /* overwrite with hint, as in this case, fingerprint's session will be truncated */
                 if ( p_data->i_duration )
                      acoustid_print.i_duration = p_data->i_duration;



More information about the vlc-commits mailing list