Open garybuhrmaster opened 3 months ago
minor edit to add a space after a comma in the first loc change for legibility.
Good catch... will get it changed. Thanks
Good catch... will get it changed. Thanks
Thanks. Obviously low priority in the grand scheme of things.
TBH, I didn't catch anything (and I probably would not have on my own as I usually use others packages), but gcc did as part of my initial/early/preliminary builds of packages for (the future) CentOS Stream 10 that I find of interest at this time, and it was a warning that I could easily understand how to address.
Compile warning due to calloc parameter reversal
When compiling libhdhomerun with a recent gcc one may receive warnings of the form:
Both hdhomerun_discover.c and hdhomerun_sock_netdevice.c have the reversed order of the parameters (other uses in the library call calloc correctly)
In practice the resulting buffer will be the same size (n elements of size 1, and 1 element of size n, should end up with the same number of bytes), but recent gcc's can detect the misuse when the -Wcalloc-transposed-args is used.
Proposed fix (compile tested only):