No subject

Thu Nov 2 09:08:48 EST 2006

    The ISO C99 standard says that if the output array isn't big enough
    and if no other errors occur, snprintf and vsnprintf truncate
    the output and return the number of bytes that ought to have been
    produced. Some older systems return the truncated length (e.g., GNU C
    Library 2.0.x or IRIX 6.5), some a negative value (e.g., earlier GNU
    C Library versions), and some the buffer length without truncation
    (e.g., 32-bit Solaris 7).  Also, some buggy older systems ignore
    the length and overrun the buffer (e.g., 64-bit Solaris 7).

So if you want to fatal() a message that is too long, you probably want
to #ifdef for non-C99 printf.


More information about the openssh-unix-dev mailing list