Subject: commit -- [Crash] Re: Startup options and configuration file parameters
From: Tom Briggs (tomabi@jules.briggs.cx)
Date: Tue Mar 06 2001 - 21:02:17 CST
Fixed Win32App to only attempt to read a value for the -verbose command
line
option if at least one more argument is present after the -verbose option
CVS: ----------------------------------------------------------------------
CVS: Enter Log.  Lines beginning with `CVS:' are removed automatically
CVS:
CVS: Committing in .
CVS:
CVS: Modified Files:
CVS:    src/wp/ap/win/ap_Win32App.cpp
CVS: ----------------------------------------------------------------------
On Tue, 6 Mar 2001, Sam TH wrote:
> On Tue, Mar 06, 2001 at 10:33:26AM +0000, Alan Horkan wrote:
> > 
> > Using the nightly build dated today (6th of march) and the cmd.exe
> >  
> > abiword -verbose 
> > causes a program crash on Windows 2000
> 
> This patch, which fixed that problem on Unix, should be applied and
> tested by one of our Windows people.  
> 
> Index: ap_Win32App.cpp
> ===================================================================
> RCS file: /cvsroot/abi/src/wp/ap/win/ap_Win32App.cpp,v
> retrieving revision 1.52
> diff -u -r1.52 ap_Win32App.cpp
> --- ap_Win32App.cpp	2001/02/06 22:54:54	1.52
> +++ ap_Win32App.cpp	2001/03/06 16:01:13
> @@ -854,7 +854,14 @@
>  			else if (UT_stricmp (m_pArgs->m_argv[k], "-verbose") == 0)
>  			{
>  				k++;
> -				verbose = atoi (m_pArgs->m_argv[k]);
> +				if(k<m_pArgs->m_argc)
> +				{
> +				    /* if we don't check we segfault
> +				       when there aren't any numbers
> +				       after --verbose
> +				    */
> +				    verbose = atoi (m_pArgs->m_argv[k]);
> +				}
>  			}
>  			else
>  			{
>            
> 	sam th		     
> 	sam@uchicago.edu
> 	http://www.abisource.com/~sam/
> 	GnuPG Key:  
> 	http://www.abisource.com/~sam/key
> 
This archive was generated by hypermail 2b25 : Tue Mar 06 2001 - 21:38:02 CST