[chbot] Chchrobotics Digest, Vol 202, Issue 14

Bevin Brett bevin_brett at hotmail.com
Wed Jul 31 00:16:28 BST 2024


I wonder which 'man' page Robin's system has on it.   The "man" page is not, of course, the official specification of snprintf or anything else.
https://man7.org/linux/man-pages/man3/snprintf.3p.html refers to
https://man7.org/linux/man-pages/man3/fprintf.3p.html which has this disclaimer

COPYRIGHT         top<https://man7.org/linux/man-pages/man3/fprintf.3p.html#top_of_page>

       Portions of this text are reprinted and reproduced in electronic
       form from IEEE Std 1003.1-2017, Standard for Information
       Technology -- Portable Operating System Interface (POSIX), The
       Open Group Base Specifications Issue 7, 2018 Edition, Copyright
       (C) 2018 by the Institute of Electrical and Electronics
       Engineers, Inc and The Open Group.  In the event of any
       discrepancy between this version and the original IEEE and The
       Open Group Standard, the original IEEE and The Open Group
       Standard is the referee document. The original Standard can be
       obtained online at http://www.opengroup.org/unix/online.html .

But I note that this man page also has a clear definition of 'n'


       The snprintf() function shall be equivalent to sprintf(), with
       the addition of the n argument which states the size of the
       buffer referred to by s.  If n is zero, nothing shall be written
       and s may be a null pointer. Otherwise, output bytes beyond the
       n‐1st shall be discarded instead of being written to the array,
       and a null byte is written at the end of the bytes actually
       written into the array.



-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ourshack.com/pipermail/chchrobotics/attachments/20240730/2a8e6173/attachment.html>


More information about the Chchrobotics mailing list