Use pclose() instead of fclose()
commit6729ba31a844389bbf4decb77992d228f5dba909
authorMikel Olasagasti Uranga <mikel@olasagasti.info>
Tue, 17 May 2022 10:52:08 +0000 (17 12:52 +0200)
committerJoey Hess <joeyh@joeyh.name>
Wed, 18 May 2022 16:47:04 +0000 (18 12:47 -0400)
treec4f4a7f30e26b3791c19479ce53aab9f08939ea7
parentee8e013cd5398c5fb34fb19a24db0f3b6185bac3
Use pclose() instead of fclose()

The return value from popen() is a normal standard I/O stream in all
respects save that it must be closed with pclose() rather than
fclose(3).

Solves the following warning when compiled with -Wmismatched-dealloc:

errno.c: In function ‘search_all’:
errno.c:126:5: warning: ‘fclose’ called on pointer returned from a
                         mismatched allocation function
                         [-Wmismatched-dealloc]
  126 |     fclose(f);
      |     ^~~~~~~~~
errno.c:113:9: note: returned from ‘popen’
  113 |     f = popen("locale -a", "r");
      |         ^~~~~~~~~~~~~~~~~~~~~~~
errno.c