PVS-StudioWarnings

PVS-Studio warning V584 for Asterisk

Nov 18th, 2014
165
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.60 KB | None | 0 0
  1. static void check_send_queue(struct unistimsession *pte)
  2. {
  3.   if (pte->last_buf_available == 1) {
  4.     ....
  5.   }
  6.   else if (pte->last_seq_ack + 1 == pte->seq_server + 1) {  //<==
  7.     ....
  8.   }
  9. }
  10.  
  11. This suspicious code was found in Asterisk project by PVS-Studio static code analyzer.
  12. Warning message is:
  13. V584 The '1' value is present on both sides of the '==' operator. The expression is incorrect or it can be simplified. chan_unistim.c 1095
  14.  
  15. PVS-Studio is a static analyzer for detecting bugs in the source code of applications written in C, C++, C++11, C++/CX. Site: http://www.viva64.com/en/pvs-studio/
Advertisement
Add Comment
Please, Sign In to add comment