Bug 146603 - slang-2.0.5-3: dodgy code
Summary: slang-2.0.5-3: dodgy code
Status: RESOLVED FIXED
Alias: None
Product: SUSE LINUX 10.0
Classification: openSUSE
Component: Basesystem (show other bugs)
Version: unspecified
Hardware: All SUSE Other
: P5 - None : Minor
Target Milestone: ---
Assignee: Vladimir Nadvornik
QA Contact: E-mail List
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-01-30 13:59 UTC by David Binderman
Modified: 2006-01-31 09:31 UTC (History)
0 users

See Also:
Found By: Other
Services Priority:
Business Priority:
Blocker: ---
Marketing QA Status: ---
IT Deployment: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description David Binderman 2006-01-30 13:59:20 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;
Comment 1 Vladimir Nadvornik 2006-01-30 16:42:45 UTC
The code really looks suspiciously. I sent this report to slang mailinglist.

Comment 2 Vladimir Nadvornik 2006-01-31 09:31:27 UTC
It was a bug and it will be fixed in upstream slang 2.0.6.
I have fixed the SUSE package.