Bug 82190

Summary: broken source code
Product: [Retired] Red Hat Linux Reporter: d.binderman
Component: nvi-m17nAssignee: Akira TAGOH <tagoh>
Status: CLOSED RAWHIDE QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: 8.0   
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2003-05-01 12:51:17 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description d.binderman 2003-01-19 10:36:27 UTC
From Bugzilla Helper:
User-Agent: Mozilla/4.6 [en-gb]C-CCK-MCD NetscapeOnline.co.uk  (Win98; I)

Description of problem:

Hello there,

I just tried to compile package nvi-m17n-1.79-20011024.6 from Redhat 8.0

The compiler said

../ex/ex_txt.c:420: warning: operation on `scno' may be undefined
../vi/v_txt.c:2173: warning: operation on `target' may be undefined
../common/multi_iso2022.c:1141: warning: operation on `p' may be undefined

Here is an untested patch to shut up the compiler.

*** ./common/multi_iso2022.c.old	2003-01-17 17:38:46.000000000 +0000
--- ./common/multi_iso2022.c	2003-01-17 17:39:21.000000000 +0000
***************
*** 1138,1144 ****
  		if (dst) {
  			p = t;
  			while (*p)
! 				dst[p - t] = *p++;
  		}
  	}
  
--- 1138,1147 ----
  		if (dst) {
  			p = t;
  			while (*p)
! 			{
! 				dst[p - t] = *p;
! 				p++;
! 			}
  		}
  	}
  
*** ./ex/ex_txt.c.old	2003-01-17 17:36:44.000000000 +0000
--- ./ex/ex_txt.c	2003-01-17 17:37:32.000000000 +0000
***************
*** 417,423 ****
  
  	/* Get the previous shiftwidth column. */
  	cno = scno;
! 	scno -= --scno % sw;
  
  	/*
  	 * Since we don't know what comes before the character(s) being
--- 417,424 ----
  
  	/* Get the previous shiftwidth column. */
  	cno = scno;
! 	--scno;
! 	scno -= scno % sw;
  
  	/*
  	 * Since we don't know what comes before the character(s) being
*** ./vi/v_txt.c.old	2003-01-17 17:37:50.000000000 +0000
--- ./vi/v_txt.c	2003-01-17 17:38:25.000000000 +0000
***************
*** 2170,2176 ****
  	if (isindent)
  		target += COL_OFF(target, sw);
  	else
! 		target -= --target % sw;
  
  	/*
  	 * The AI characters will be turned into overwrite characters if the
--- 2170,2179 ----
  	if (isindent)
  		target += COL_OFF(target, sw);
  	else
! 	{
! 		--target;
! 		target -= target % sw;
! 	}
  
  	/*
  	 * The AI characters will be turned into overwrite characters if the

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


How reproducible:
Always

Steps to Reproduce:
1. compile the source code
2.
3.
    

Additional info

Comment 1 Akira TAGOH 2003-05-01 12:51:17 UTC
fixed in 1.79-20011024.13. such warnings are no longer appeared on 9, but
another warnings are shwon. so this fix is for anoher warnings, though.