[emboss-dev] obselete bug in ajnam.c?

C Thomas cjt01 at uark.edu
Tue Jul 19 00:41:53 UTC 2005

I was hunting through the emboss-2.10 source, when I found the  
following code in ajnam.c, inside the namListParse() function, which  
parses the emboss.default file and builds database definitions,  
environment definitions, etc.... at about line 1195:

       if(ajStrChar(curword, -1) == ':')
             /* if last character is : then its a keyword */
             ajStrToLower(&curword); /* make it lower case */
             db_input = namDbAttr(curword);
             if(db_input < 0)
             ajWarn("%S: bad attribute '%S' for database '%S'\n",
                 namRootStr, curword, name);
         else if(db_input >= 0)
             /* So if keyword type has been set */
             if(ajStrChar(curword, 0) == '\'')

It seems to me that the else if statement will never be executed,  
since the only chance db_input will ever get to be changed from its  
initialized value of -1 is inside the body of the previous if statement.

By the way, the way the original source code file was tab formatted  
visually hid the bug, because there the statements "if(db_input < 0)"  
and "else if(db_input >= 0)" were on the same tab level.  That's more  
like a formatting bug ;)

Maybe this has already been rewritten in the new CVS version, I don't  
know because I only use the 2.10 version.  Or maybe I'm mistaken and  
it isn't even a bug.

Hope this is useful.

C. Thomas

More information about the emboss-dev mailing list