Text   |  XML   |  ReML   |   Visible Warnings:

Unreachable Data Flow  at packet-vcdu.c:188

No properties have been set. | edit properties
Jump to warning location ↓ warning details...
Show Events | Options

smex_time_to_string

(/home/sate/Testcases/c/cve/wireshark-1.2.0/epan/dissectors/packet-vcdu.c)expand/collapse
Show more  
 161  static const char* smex_time_to_string ( int pb5_days_since_midnight_9_10_oct_1995, int pb5_seconds, int pb5_milliseconds )
 162  {
 163          static const char* fmt = "%04d/%03d:%02d:%02d:%02d.%03d";
 164          static char juliantime[40];
 165          static int utcdiff = 0;
 166   
 167          static int Days[2][13] =
 168          {
 169            { 0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 },
 170            { 0, 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 }
 171          };
 172   
 173          int utc, yr, year, julianday, hour, minute, second;
 174          int ix, days, month;
 175   
 176          /* compute the static constant difference in seconds 
 177           * between midnight 9-10 October 1995 (PB5 time) and 
 178           * seconds since 1/1/1970 (UTC time) just this once 
 179           */
 180          if ( 0 == utcdiff )
 181          {
 182            for ( yr=1970; yr < 1995; ++yr )
 183            {
 184              utcdiff += ( Leap(yr)  ?  366 : 365 ) * 24 * 60 * 60;
 185            }
 186   
 187            days = 0;
 188            ix = ( Leap(1995)  ?  1 : 0 );
 189   
 190            for ( month=1; month < 10; ++month )
 191            {
 192              days += Days[ix][month];
 193            }
 194   
 195            days += 9;  /* this gets us up to midnight october 9-10 */
 196   
 197            utcdiff += days * 24 * 60 * 60;  /* add days in 1995 prior to October 10 */
 198          }
 199   
 200          utc = ( pb5_days_since_midnight_9_10_oct_1995 * 86400 ) + pb5_seconds + utcdiff;
 201          utc_to_julian ( utc, &year, &julianday, &hour, &minute, &second );
 202   
 203          g_snprintf ( juliantime, sizeof(juliantime), fmt, year, julianday, hour, minute, second, pb5_milliseconds );
 204   
 205          return juliantime;
 206   
 207  }
Show more  




Change Warning 3026.29497 : Unreachable Data Flow

Priority:
State:
Finding:
Owner:
Note: