aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVedran Grudenic <grudenic.vedran@gmail.com>2019-04-05 17:13:23 +0200
committerMarco Paland <marco@paland.com>2019-04-05 19:08:27 +0200
commit21eea6c9a785f221181adedbe9cbcd0f585cc41e (patch)
treeb977d1dabe382e9ed15e2ce3bd08e83e6f8e58df
parentf30c9ac5c9278c4522b429fd95a4f90d5c75ed7a (diff)
downloadprintf-21eea6c9a785f221181adedbe9cbcd0f585cc41e.tar.gz
printf-21eea6c9a785f221181adedbe9cbcd0f585cc41e.tar.bz2
printf-21eea6c9a785f221181adedbe9cbcd0f585cc41e.zip
Fixed the comment about the return value for snprintf and vsnprintf (issue #45)
-rw-r--r--printf.h5
1 files changed, 3 insertions, 2 deletions
diff --git a/printf.h b/printf.h
index 6075bc2..6104ccf 100644
--- a/printf.h
+++ b/printf.h
@@ -78,8 +78,9 @@ int sprintf_(char* buffer, const char* format, ...);
* \param count The maximum number of characters to store in the buffer, including a terminating null character
* \param format A string that specifies the format of the output
* \param va A value identifying a variable arguments list
- * \return The number of characters that are WRITTEN into the buffer, not counting the terminating null character
- * If the formatted string is truncated the buffer size (count) is returned
+ * \return The number of characters that COULD have been written into the buffer, not counting the terminating
+ * null character. A value equal or larger than count indicates truncation. Only when the returned value
+ * is non-negative and less than count, the string has been completely written.
*/
#define snprintf snprintf_
#define vsnprintf vsnprintf_