Skip to content
GitLab
    • Why GitLab
    • Pricing
    • Contact Sales
    • Explore
  • Why GitLab
  • Pricing
  • Contact Sales
  • Explore
  • Sign in
  • Register
  • libvirtlibvirt
  • libvirtlibvirt
  • Repository
  • libvirt
  • src
  • util
  • virsocket.c
Find file Blame History Permalink
  • Michal Privoznik's avatar
    lib: use struct zero initializer instead of memset · b20a5e9a
    Michal Privoznik authored Aug 02, 2023
    
    
    This is a more concise approach and guarantees there is
    no time window where the struct is uninitialized.
    
    Generated using the following semantic patch:
    
      @@
      type T;
      identifier X;
      @@
      -  T X;
      +  T X = { 0 };
         ... when exists
      (
      -  memset(&X, 0, sizeof(X));
      |
      -  memset(&X, 0, sizeof(T));
      )
    
    Signed-off-by: default avatarMichal Privoznik <mprivozn@redhat.com>
    Reviewed-by: default avatarClaudio Fontana <cfontana@suse.de>
    b20a5e9a