Re: _sntprintf and _sntprintf_s



I think in this case number of characters means TCHAR's, not number of
codepoints.

"Norman Diamond" <ndiamond@xxxxxxxxxxxxxxxx> wrote in message
news:udOyprwgGHA.1856@xxxxxxxxxxxxxxxxxxxxxxx

This looks terrible. Actually _snwprintf_s looks mostly OK, since the
programmer wants to do calculations on the number of wide characters and
keep track of how much space remains in the buffer. But why does
_snprintf_s return the number of characters instead of the number of
bytes?
If a programmer is using the ANSI version then the programmer wants to do
calculations on the number of bytes in order to keep track of how much
space
remains in the buffer. I also hope that _snwprintf_s doesn't have a split
personality on the treatment of surrogate pairs.



.



Relevant Pages

  • Re: C-programmer needs Forth advice
    ... > I am a C and assembly programmer, so I think in variables and ... > buffer, and returns the number of characters read. ... > int read ...
    (comp.lang.forth)
  • Re: A note on personal corruption as a result of using C
    ... You don't want NULs, and you don't want control characters, and you may ... YOU are just a programmer, so it's not a question of what YOU want. ... you can use C strings for everything. ... criticise the language and platform in and on which he claims to be ...
    (comp.programming)
  • RE: Update: Web browsers - a mini-farce (MSIE gives in)
    ... >> You don't have to understand how to exploit a buffer overflow in ... >> attacks to restrict SQL input fields to valid characters. ... the careful programmer will write a validation routine that rejects ...
    (Bugtraq)
  • Re: Senator Kennedys first name
    ... our IT systems because a programmer had decided that the miniumum number ... of characters in a surname was three. ... digit is even more useless than a name with extra or missing letters. ...
    (alt.usage.english)
  • Re: Segfault City
    ... Richard Heathfield wrote: ... the mark of a bad programmer is inability to think outside the ... characters with higher code ... You read in the standard that "C offers no guarantee with a code ...
    (comp.lang.c)

Quantcast