Re: [AD] 3.9.34 release date? |
[ Thread Index |
Date Index
| More lists.liballeg.org/allegro-developers Archives
]
In message <01011000421700.02024@xxxxxxxxxx>, Henrik Stokseth writes:
>let's try to release a new wip by the end of the week. in the meantime we
>should try to fix known problems (i only know of the dga2 one, if you ignore
>the mac port)
Here's a patch for a minor bug. The code which parses the command-line into
argv and argc for MS Windows doesn't add a terminating NULL value to argv.
You won't notice if you use argc to stop reading, but will if you iterate
through argv until you hit a NULL entry.
Incidentally, wouldn't it be safer to declare argv to have 129 entries
rather than 64? 129 is the most a 256 character command line can possibly
generate (all one character arguments plus terminating NULL), and 260 bytes
of extra storage seems a small price to pay for elminating this potential
overflow.
And is 256 a limit for the command line? There's no limit mentioned in:
http://msdn.microsoft.com/library/psdk/winbase/prothred_0mzp.htm
Cheers,
Olly
Index: src/win/wsystem.c
===================================================================
RCS file: /cvsroot/alleg/allegro/src/win/wsystem.c,v
retrieving revision 1.6
diff -u -r1.6 wsystem.c
--- src/win/wsystem.c 2000/11/09 20:59:14 1.6
+++ src/win/wsystem.c 2001/01/10 13:46:56
@@ -387,6 +387,8 @@
}
}
+ argv[argc] = NULL;
+
/* call the application entry point */
return mainfunc(argc, argv);
}