diff options
author | Ismael Luceno <ismael@iodev.co.uk> | 2024-01-25 07:56:58 +0100 |
---|---|---|
committer | Matěj Cepl <mcepl@cepl.eu> | 2024-05-19 09:03:59 +0200 |
commit | bcdfa6b7ce3184b1fd7372716703248aeb14384e (patch) | |
tree | 70ed1c70a3ff2807f84ab45181787a5a0ada8f8d | |
parent | 20e9865618c06205616db9f1196535bc0c6e9332 (diff) | |
download | lout-nits.tar.gz |
Avoid calling catclose with an invalid argumentnits
POSIX doesn't specify that catclose should accept -1 as argument, and with
musl (1.2.4 and earlier at least) it causes a segfault.
-rw-r--r-- | z01.c | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -974,7 +974,8 @@ int main(int argc, char *argv[]) while( run_num <= runs_to_do ); #if LOCALE_ON - catclose(MsgCat); + if (MsgCat != (nl_catd)-1) + catclose(MsgCat); #endif exit(0); |