From: Venkatesh Prasad <venkatesh.prasad@digital.com>
Subject: Re: vsprintf problems.
Date: Fri, 17 Aug 2001 10:56:28 +0200 [thread overview]
Message-ID: <3B7CDC3C.74ACCA96@digital.com> (raw)
In-Reply-To: 3B7BCE16.BFF56779@digital.com
Hi all,
I got the information I was looking for and deemed it appropriate to share
it with the group.
There is a problem with sprintf , printf, vsprintf etc. when you use
RWCString or SString.
For example if you do:
RWCString s("Hello World");
char buf[32];
sprintf(buf,"%s",s);
You get a Seg Fault!
You should therefore use:
sprintf(buf,"%s",(const char *)s);
With warm regards,
-Venkatesh Prasad R.
Venkatesh Prasad wrote:
> Hi all,
> I am using the latest cxx (version V6.3-012) on tru 64 unix OSF1 V5.1
> 732 alpha.
>
> When I do a vsprintf as follows:
>
> vsprintf(msg_buf,format,va_args);
>
> I get a core dump. The core trac points to the vsprintf statement.
>
> This did not use to happen in the previous release of the cxx compiler.
>
> Thanks in advance for your help.
>
> With warm regards,
> -Venkatesh Prasad R.
prev parent reply other threads:[~2001-08-17 8:56 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2001-08-16 13:43 vsprintf problems Venkatesh Prasad
2001-08-17 8:56 ` Venkatesh Prasad [this message]
read-only archive
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox