• vasil's avatar
    Add ut_snprintf() function. On Windows this needs to be implemented · 6a0f6df9
    vasil authored
    using auxiliary functions because there is no snprintf-variant on
    Windows that behaves exactly as specified in the standard:
    
    * Always return the number of characters that would have been printed
      if the size were unlimited (not including the final `\0').
    * Always '\0'-terminate the result
    * Do not touch the buffer if size=0, only return the number of characters
      that would have been printed. Can be used to estimate the size needed
      and to allocate it dynamically.
    
    See http://www.freebsd.org/cgi/query-pr.cgi?pr=87260 for the reason why
    2 ap variables are used.
    
    Approved by:	Heikki
    6a0f6df9
ut0ut.c 11.9 KB