Bugzilla – Bug 146603
slang-2.0.5-3: dodgy code
Last modified: 2006-01-31 09:31:27 UTC
I just tried to compile package slang-2.0.5-3 with the Intel C compiler. It said /usr/src/packages/BUILD/slang-2.0.5/src/slcommon.c(107): warning #187: use of "=" where "==" may have been intended /usr/src/packages/BUILD/slang-2.0.5/src/slcommon.c(108): warning #187: use of "=" where "==" may have been intended /usr/src/packages/BUILD/slang-2.0.5/src/slcommon.c(109): warning #187: use of "=" where "==" may have been intended The source code is if (((locale == NULL) || (*locale == 0)) && ((NULL == (locale = getenv ("LC_ALL"))) || (*locale = 0)) && ((NULL == (locale = getenv ("LC_CTYPE"))) || (*locale = 0)) && ((NULL == (locale = getenv ("LANG"))) || (*locale = 0))) return 0; Maybe the programmer intended if (((locale == NULL) || (*locale == 0)) && ((NULL == (locale = getenv ("LC_ALL"))) || (*locale == 0)) && ((NULL == (locale = getenv ("LC_CTYPE"))) || (*locale == 0)) && ((NULL == (locale = getenv ("LANG"))) || (*locale == 0))) return 0;
The code really looks suspiciously. I sent this report to slang mailinglist.
It was a bug and it will be fixed in upstream slang 2.0.6. I have fixed the SUSE package.