You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -66,7 +66,7 @@ Whichever way you choose to use the library:
66
66
67
67
* You can have this library stand-in for the C standard library's `printf()` family of functions, e.g. provide `snprintf()` instead of `snprintf_()`, by setting an appropriate [preprocessor definition](#cmake-options-and-preprocessor-definitions) during compilation and use.
68
68
* Speaking of the preprocessor definition [preprocessor definitions](#cmake-options-and-preprocessor-definitions) which affect the library's behavior - you have to be consistent in their choice when building and when using the library. (The easiest way to do that is just not to change any of them and accept the reasonable defaults.)
69
-
* Two of the functions --- `printf_()` and `vprintf_()` --- will only be usable if you implement a `_putchar(char c)` function for them to use.
69
+
* Two of the functions --- `printf_()` and `vprintf_()` --- will only be usable if you implement a `putchar_(char c)` function for them to use.
70
70
***Avoid `sprintf()` in favor of `snprintf()` for safety and security** - and that goes for the standard C library `sprintf()` as well:. `sprintf()` is unaware of the amount of memory allocated for the string it writes into, and will "happily" overflow your buffer; instead of calling it, pass your buffer size to `snprintf()` - and avoid overflow.
71
71
72
72
Finally, if you've started using the library in a publicly-available (FOSS or commercial) project, please consider emailing [@eyalroz](https://github.com/eyalroz), or open an [issue](https://github.com/eyalroz/printf/issues/), to announce this.
@@ -117,7 +117,7 @@ int snprintf_(char* buffer, size_t count, const char* format, ...);
117
117
int vsnprintf_(char* buffer, size_t count, const char* format, va_list va);
118
118
int vprintf_(const char* format, va_list va);
119
119
```
120
-
Note that `printf()` and `vprintf()` don't actually write anything on their own: In addition to their parameters, you must provide them with a lower-level `_putchar()` function which they can call for actual printing. This is part of this library's independence: It is isolated from dealing with console/serial output, files etc.
120
+
Note that `printf()` and `vprintf()` don't actually write anything on their own: In addition to their parameters, you must provide them with a lower-level `putchar_()` function which they can call for actual printing. This is part of this library's independence: It is isolated from dealing with console/serial output, files etc.
121
121
122
122
Two additional functions are provided beyond those available in the standard library:
0 commit comments