Bug 79231 - bad source code
Summary: bad source code
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: nmap
Version: 8.0
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Harald Hoyer
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2002-12-08 10:32 UTC by d.binderman
Modified: 2008-05-01 15:38 UTC (History)
0 users

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2003-01-09 15:07:21 UTC


Attachments (Terms of Use)

Description d.binderman 2002-12-08 10:32:54 UTC
Description of Problem:

Hello there,

I just tried to compile package nmap-3.00-1 from Redhat 8.0.

Here are some of the compiler messages.

tcpip.c:416: warning: operation on `i' may be undefined
tcpip.c:459: warning: operation on `i' may be undefined

Here is a patch which fixes the messages.
  
*** ./tcpip.c.old	2002-11-18 11:55:04.000000000 +0000
--- ./tcpip.c	2002-11-18 11:56:58.000000000 +0000
***************
*** 413,419 ****
  }
  if (readdata && i < tot_len) {
  printf("Data portion:\n");
! while(i < tot_len)  printf("%2X%c", data[i], (++i%16)? ' ' : '\n');
  printf("\n");
  }
  return 0;
--- 413,423 ----
  }
  if (readdata && i < tot_len) {
  printf("Data portion:\n");
! while(i < tot_len)  
! {
! 	printf("%2X%c", data[ i], ((i + 1) % 16) ? ' ' : '\n');
! 	++i;
! }
  printf("\n");
  }
  return 0;
***************
*** 456,462 ****
  }
   if (readdata && i < tot_len) {
     printf("Data portion:\n");
!    while(i < tot_len)  printf("%2X%c", data[i], (++i%16)? ' ' : '\n');
     printf("\n");
   }
   return 0;
--- 460,470 ----
  }
   if (readdata && i < tot_len) {
     printf("Data portion:\n");
!    while(i < tot_len)  
!    {
! 	printf("%2X%c", data[ i], ((i + 1) % 16) ? ' ' : '\n');
! 	++i;
!    }
     printf("\n");
   }
   return 0;


Version-Release number of selected component (if applicable):


How Reproducible:


Steps to Reproduce:
1. 
2. 
3. 

Actual Results:


Expected Results:


Additional Information:

Comment 1 Harald Hoyer 2003-01-09 15:07:21 UTC
fixed in nmap-3.00-3, please report upstream...


Note You need to log in before you can comment on or make changes to this bug.