Text  |   XML   |   Visible Warnings:

Pvm : Pvm analysis 1 : Negative Character Value  at cons.c:622

Categories: LANG.TYPE.NEGCHAR CWE:119 CWE:686
Warning ID: 2424.2448
Procedure: xtoi
Trace: View
Modified: Wed Sep 2 12:37:43 2009   show details
 
Priority: None
State: None
Finding: None
Owner: None
  edit properties

Legend [ X ]
Warning Location
Contributes
Parse Error
Other Warning
Two or More Loop Iterations
On Execution Path
Comment
Macro
Preprocessor
Include
Keyword
Preprocessed Away

Source  |  Language: C Hide Legend     
ProblemLineSource
   /u1/paul/SATE/2010/c/pvm/pvm3/console/cons.c
   Enter xtoi
 612 *
 613 *       Yet another version of ascii hex to integer 
 614 */ 
 615  
 616 xtoi(p) 
 617         char *p;
 618 {
 619         int i = 0;
 620         char c;
 621  
Type is char or signed char622         while (isxdigit(c = *p++)) {     /* Negative Character Value */
 623                 i = (i << 4) + c - (isdigit(c) ? '0' : (isupper(c) ? 'A' : 'a') - 10);   /* Negative Character Value (ID: 2425.2450) */
 624         }
 625         return i;
 626 
 627  
 628  
 629 /*      axtoi()
 630 *
 631 *       ascii hex or decimal to integer.
 632 */ 




Change Warning 2424.2448 : Negative Character Value

Priority:
State:
Finding:
Owner:
Note: