Thread overview
tchar.h error in _stprintf
Jan 02, 2004
Wu Yongwei
Jan 04, 2004
Walter
Jan 04, 2004
Matthew
Jan 15, 2004
Wu Yongwei
Jan 15, 2004
Jan Knepper
Jan 17, 2004
Wu Yongwei
Jan 17, 2004
Matthew
Jan 24, 2004
Walter
January 02, 2004
Line 345 of tchar.h is wrong. It is

#define _stprintf	_snprintf

while it should be

#define _stprintf	sprintf

Best regards,

Wu Yongwei


January 04, 2004
No, I think _snprintf is right. Things are moving towards checked buffer sizes, and sprintf is not checked.

"Wu Yongwei" <Wu_member@pathlink.com> wrote in message news:bt325l$1982$1@digitaldaemon.com...
> Line 345 of tchar.h is wrong. It is
>
> #define _stprintf _snprintf
>
> while it should be
>
> #define _stprintf sprintf
>
> Best regards,
>
> Wu Yongwei
>
>


January 04, 2004
> No, I think _snprintf is right. Things are moving towards checked buffer sizes, and sprintf is not checked.

Still sounds wrong to me. Wouldn't it be _stnprintf?

It's not a subtle change; it will break code.

> "Wu Yongwei" <Wu_member@pathlink.com> wrote in message news:bt325l$1982$1@digitaldaemon.com...
> > Line 345 of tchar.h is wrong. It is
> >
> > #define _stprintf _snprintf
> >
> > while it should be
> >
> > #define _stprintf sprintf
> >
> > Best regards,
> >
> > Wu Yongwei
> >
> >
>
>



January 15, 2004
I don't think so.  Check MSDN:

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vclib/html/_crt_sprintf.2c_.swprintf.asp

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vccore98/HTML/_crt__snprintf.2c_._snwprintf.asp

It is _sntprintf that maps to _snprintf, but not _stprintf. Your include file BREAKS code.

Best regards,

Wu Yongwei

In article <bt886a$2t6r$1@digitaldaemon.com>, Walter says...
>
>No, I think _snprintf is right. Things are moving towards checked buffer sizes, and sprintf is not checked.
>
>"Wu Yongwei" <Wu_member@pathlink.com> wrote in message news:bt325l$1982$1@digitaldaemon.com...
>> Line 345 of tchar.h is wrong. It is
>>
>> #define _stprintf _snprintf
>>
>> while it should be
>>
>> #define _stprintf sprintf
>>
>> Best regards,
>>
>> Wu Yongwei


January 15, 2004
Check the STANDARD... I think MSDN has this wrong!



Wu Yongwei wrote:

> I don't think so.  Check MSDN:
> 
> http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vclib/html/_crt_sprintf.2c_.swprintf.asp
> 
> http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vccore98/HTML/_crt__snprintf.2c_._snwprintf.asp
> 
> It is _sntprintf that maps to _snprintf, but not _stprintf. Your include file
> BREAKS code.
> 
> Best regards,
> 
> Wu Yongwei
> 
> In article <bt886a$2t6r$1@digitaldaemon.com>, Walter says...
> 
>>No, I think _snprintf is right. Things are moving towards checked buffer
>>sizes, and sprintf is not checked.
>>
>>"Wu Yongwei" <Wu_member@pathlink.com> wrote in message
>>news:bt325l$1982$1@digitaldaemon.com...
>>
>>>Line 345 of tchar.h is wrong. It is
>>>
>>>#define _stprintf _snprintf
>>>
>>>while it should be
>>>
>>>#define _stprintf sprintf
>>>
>>>Best regards,
>>>
>>>Wu Yongwei
> 
> 
> 


-- 
ManiaC++
Jan Knepper

But as for me and my household, we shall use Mozilla... www.mozilla.org
January 17, 2004
Sorry, what standard?! The C standard never mentions anything about tchar.h or _stprintf. In fact, the prefixing underscore in the name "_stprintf" has already told you that it is NON-standard.

The whole tchar stuff is defined by Microsoft. Microsoft IS the standard, in this case. I never see any Win32 compiler other than DMC deviate from the MSDN documentation. I have checked with MSVC, MinGW GCC, and BCC. This behaviour is specific to DMC and BREAKS code!

Regards,

Wu Yongwei

In article <bu69s9$2br8$1@digitaldaemon.com>, Jan Knepper says...
>
>Check the STANDARD... I think MSDN has this wrong!
>
>
>
>Wu Yongwei wrote:
>
>> I don't think so.  Check MSDN:
>> 
>> http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vclib/html/_crt_sprintf.2c_.swprintf.asp
>> 
>> http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vccore98/HTML/_crt__snprintf.2c_._snwprintf.asp
>> 
>> It is _sntprintf that maps to _snprintf, but not _stprintf. Your include file BREAKS code.
>> 
>> Best regards,
>> 
>> Wu Yongwei
>> 
>> In article <bt886a$2t6r$1@digitaldaemon.com>, Walter says...
>> 
>>>No, I think _snprintf is right. Things are moving towards checked buffer sizes, and sprintf is not checked.
>>>
>>>"Wu Yongwei" <Wu_member@pathlink.com> wrote in message news:bt325l$1982$1@digitaldaemon.com...
>>>
>>>>Line 345 of tchar.h is wrong. It is
>>>>
>>>>#define _stprintf _snprintf
>>>>
>>>>while it should be
>>>>
>>>>#define _stprintf sprintf


January 17, 2004
I've just looked in the standard, and there is no ???tprintf. Are you walking about an amendment? If so, what is it? I find it *really* hard to believe that DMC++ has it correct.

"Jan Knepper" <jan@smartsoft.us> wrote in message news:bu69s9$2br8$1@digitaldaemon.com...
> Check the STANDARD... I think MSDN has this wrong!
>
>
>
> Wu Yongwei wrote:
>
> > I don't think so.  Check MSDN:
> >
> >
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vclib/html/_crt_sprintf.2c_.swprintf.asp
> >
> >
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vccore98/HTML/_crt__snprintf.2c_._snwprintf.asp
> >
> > It is _sntprintf that maps to _snprintf, but not _stprintf. Your include
file
> > BREAKS code.
> >
> > Best regards,
> >
> > Wu Yongwei
> >
> > In article <bt886a$2t6r$1@digitaldaemon.com>, Walter says...
> >
> >>No, I think _snprintf is right. Things are moving towards checked buffer sizes, and sprintf is not checked.
> >>
> >>"Wu Yongwei" <Wu_member@pathlink.com> wrote in message news:bt325l$1982$1@digitaldaemon.com...
> >>
> >>>Line 345 of tchar.h is wrong. It is
> >>>
> >>>#define _stprintf _snprintf
> >>>
> >>>while it should be
> >>>
> >>>#define _stprintf sprintf
> >>>
> >>>Best regards,
> >>>
> >>>Wu Yongwei
> >
> >
> >
>
>
> -- 
> ManiaC++
> Jan Knepper
>
> But as for me and my household, we shall use Mozilla... www.mozilla.org


January 24, 2004
Fixed. -Walter