Mail Archives: djgpp/1995/07/16/02:08:19
> /* Then I startet it with go32 a.out Gl"uh Wurm
> ^^- We use so called Umlaute
> in the german language,
> The output is: ( see MS-DOS Codepage 437,
> Number 129 ).
> Argumentnr. 0: a.out
> Argumentnr. 1: Gl
>
> thats all... :-(
That's a bug in go32 code which is invoked to produce the *argv[] array
before your application's main() function is called. There is a function
there called parse_chars() which casts a char to an int and then decides
that any character <= 0 designates an end of the argv[i] string. (This
code is in the file control.c which is part of go32 source distribution in
the djsrc112.zip archive.) Characters with ASCII code greater than 128
produce a negative int during this cast, with the obvious results.
Solution: if you need this badly and can't wait until v2.0 (which doesn't
have this bug), get the go32 sources and correct that code (by using unsigned
chars as God intended).
Btw, a similar error lurks to get you in all of the ctype functions in the
v1.x library: they reference a character-classification array with an index
produced by casting the character to an int, which produces a negative index,
unless your char is an unsigned char.
- Raw text -