Subject: Re: [Crash] Re: Startup options and configuration file parameters
From: Sam TH (sam@uchicago.edu)
Date: Tue Mar 06 2001 - 10:07:40 CST
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 - 10:02:55 CST