NagiosEnterprises / nagioscore

Nagios Core
GNU General Public License v2.0
1.48k stars 440 forks source link

Cleanup warnings #901

Closed dougnazar closed 1 year ago

dougnazar commented 1 year ago

This removes all the warnings I see with GCC & CLANG excluding unused-result.

  Remove const to fix warning passing mrtg_delimiter to free()
  Rewrite some path building areas to fix warnings.
  Shrink some string variables unneeded size to remove warnings about possible truncation during copy.
  Regenerate wpres-phash.h using ANSI-C output.
  Fix warning about indentation
  Remove unused function.
  Remove variables that are written to but never read.
  Cast RAND_MAX to float to avoid Clang warning.
  Initialize a couple variables that might be used uninitialized.
  Don't try to print temp_ptr as it is always NULL.
  strcpy() doesn't allow overlapping buffers.
sawolf commented 1 year ago

Hi Doug, thanks for the fixes! One of those changes (a239caa) implies a relatively important bugfix, but that's more on me to resolve. This should be merged shortly.