global static pointer variable in DLL

Koroskin Denis 2korden at gmail.com
Sun May 25 12:24:18 PDT 2008


On Sun, 25 May 2008 22:57:35 +0400, Zarathustra  
<adam.chrapkowski at gmail.com> wrote:

> Ok I resolved this problem by change std.c.stdlib.malloc on  
> std.gc.malloc.
> But now I still have a problem with fprintf() functions.
> code:
> ________________________________________________________
> offs = fprintf(gl2ps.stream,
>                  "1 0 obj\n<<\n/Title (%s)\n/Creator (GL2PS %d.%d.%d%s,  
> %s)\n/Producer (%s)\n",
>                  gl2ps.title, GL2PS_MAJOR_VERSION, GL2PS_MINOR_VERSION,
>                  GL2PS_PATCH_VERSION, GL2PS_EXTRA_VERSION,  
> GL2PS_COPYRIGHT,
>                  gl2ps.producer);
> ________________________________________________________
> Unhandled Exception: EXCEPTION_ACCESS_VIOLATION(0xc0000005) at _strlen  
> (0x0042a37d) thread(3380)
>
> but when I change it:
> code
> ________________________________________________________
>   offs = fprintf(gl2ps.stream,
>                  /*"1 0 obj\n<<\n/Title (%s)\n/Creator (GL2PS  
> %d.%d.%d%s, %s)\n/Producer (%s)\n",*/
>                  gl2ps.title, GL2PS_MAJOR_VERSION, GL2PS_MINOR_VERSION,
>                  GL2PS_PATCH_VERSION, GL2PS_EXTRA_VERSION,  
> GL2PS_COPYRIGHT,
>                  gl2ps.producer);
> ________________________________________________________
> everything is ok :/, too long string or what?

Looks like you provide a null-pointer as a string to fprintf...


More information about the Digitalmars-d-learn mailing list