Discussion
Topics
Last Day
Last Week
Tree View

Search
New Messages
Keyword Search

Help
Getting Started
Formatting
Troubleshooting
Program Credits

Utilities
Edit Profile
Administration
Contact

 
forum - discussion board
- about - downloads - registration - forum - misc - home - © 1996-99 GWD Text Editor

Malfunction on argc / argv

GWD Text Editor Forum: Technical Support: Malfunction on argc / argv
Top of pagePrevious messageNext messageBottom of pageLink to this message  By Steven G Schooler on Thursday, May 18, 2000 - 07:21 pm:

tabsize.c gpf'd (crashed) my GWD (v3.0) session in Windows 95 (OSR2-B). I followed instructions re running it with a parameter:

  • Param1 "tabsize.c 9"
  • ExecScript

and running it without a parameter. I investigated the resulting argc and argv values and found the following 2 anomalies:

Running it with a parameter, argc = 3; running it without a parameter, argc = 2. This explains the crash. But why is argc consistently 1 more than normal? For example, I would expect argc = 2, when run with a parameter.

When running with a parameter, the following formula
(int) ( (sizeof(argv)) / (sizeof(char *)) )

returns a value of 1, rather than 2, even though argv[1] != NULL (i.e. *argv[1] = "9"). I double checked the syntax in the above formula with a standard array. Why does the formula miscalculate when specifically applied to the argv array?

Top of pagePrevious messageNext messageBottom of pageLink to this message  By Vedran Gaco (Vgaco) on Friday, May 19, 2000 - 06:35 am:

Thanks for bug report. When you run the program without parameters, it sends two arguments in argv, program name, and NULL (terminator) argument. NULL argument should not be counted, but GWD Text Editor count it. Bug will be fixed in the first minor update.


Add a Message


This is a public posting area. If you do not have an account, enter your full name into the "Username" box and leave the "Password" box empty. Your e-mail address is optional.
Username:  
Password:
E-mail:


- about - downloads - registration - forum - misc - home - © 1996-99 GWD Text Editor