Commit | Line | Data |
---|---|---|
ae59e04c | 1 | .\" Copyright (c) 1990, 1991 The Regents of the University of California. |
411867e7 | 2 | .\" All rights reserved. |
c3ce85c3 | 3 | .\" |
411867e7 | 4 | .\" This code is derived from software contributed to Berkeley by |
043368e6 KB |
5 | .\" Chris Torek and the American National Standards Committee X3, |
6 | .\" on Information Processing Systems. | |
7 | .\" | |
411867e7 KB |
8 | .\" %sccs.include.redist.man% |
9 | .\" | |
043368e6 | 10 | .\" @(#)printf.3 6.13 (Berkeley) %G% |
411867e7 | 11 | .\" |
ae59e04c CL |
12 | .Dd |
13 | .Dt PRINTF 3 | |
14 | .Os | |
15 | .Sh NAME | |
16 | .Nm printf , | |
17 | .Nm fprintf , | |
18 | .Nm sprintf , | |
19 | .Nm snprintf , | |
20 | .Nm vprintf , | |
21 | .Nm vfprintf, | |
22 | .Nm vsprintf , | |
23 | .Nm vsnprintf | |
24 | .Nd formatted output conversion | |
25 | .Sh SYNOPSIS | |
26 | .Fd #include <stdio.h> | |
27 | .Ft int | |
28 | .Fn printf "const char *format" ... | |
29 | .Ft int | |
30 | .Fn fprintf "FILE *stream" "const char *format" ... | |
31 | .Ft int | |
32 | .Fn sprintf "char *str" "const char *format" ... | |
33 | .Ft int | |
34 | .Fn snprintf "char *str" "size_t size" "const char *format" ... | |
35 | .\" .Ft int | |
36 | .\" .Fn smprintf "const char *format" ... | |
108b3140 | 37 | .Fd #include <stdarg.h> |
ae59e04c CL |
38 | .Ft int |
39 | .Fn vprintf "const char *format" "va_list ap" | |
40 | .Ft int | |
41 | .Fn vfprintf "FILE *stream" "const char *format" "va_list ap" | |
42 | .Ft int | |
43 | .Fn vsprintf "char *str" "char *format" "va_list ap" | |
44 | .Ft int | |
45 | .Fn vsnprintf "char *str" "size_t size" "const char *format" "va_list ap" | |
46 | .\" .Ft int | |
47 | .\" .Fn vsmprintf "const char *format" "va_list ap" | |
48 | .Sh DESCRIPTION | |
411867e7 | 49 | The |
ae59e04c | 50 | .Fn printf |
411867e7 | 51 | family of functions produces output according to a |
ae59e04c | 52 | .Fa format |
411867e7 | 53 | as described below. |
ae59e04c | 54 | .Fn Printf |
df27e01d | 55 | and |
ae59e04c CL |
56 | .Fn vprintf |
57 | write output to | |
58 | .Em stdout, | |
59 | the standard output stream; | |
60 | .Fn fprintf | |
df27e01d | 61 | and |
ae59e04c CL |
62 | .Fn vfprintf |
63 | write output to the given output | |
64 | .Fa stream ; | |
65 | .Fn sprintf , | |
66 | .Fn snprintf , | |
67 | .Fn vsprintf , | |
df27e01d | 68 | and |
ae59e04c | 69 | .Fn vsnprintf |
411867e7 | 70 | write to the character string |
ae59e04c | 71 | .Fa str . |
411867e7 KB |
72 | .\" .IR str ; |
73 | .\" and | |
74 | .\" .I smprintf | |
75 | .\" and | |
76 | .\" .I vsmprintf | |
77 | .\" dynamically allocate a new string with | |
78 | .\" .IR malloc . | |
ae59e04c CL |
79 | These functions write the output under the control of a |
80 | .Fa format | |
81 | string that specifies how subsequent arguments | |
82 | (or arguments accessed via the variable-length argument facilities of | |
108b3140 | 83 | .Xr stdarg 3 ) |
ae59e04c | 84 | are converted for output. |
411867e7 KB |
85 | .\" Except for |
86 | .\" .I smprintf | |
87 | .\" and | |
88 | .\" .IR vsmprintf , | |
89 | .\" all of these functions return | |
ae59e04c | 90 | These functions return |
411867e7 | 91 | the number of characters printed |
ae59e04c CL |
92 | (not including the trailing |
93 | .Ql \e0 | |
94 | used to end output to strings). | |
411867e7 KB |
95 | .\" .I Smprintf |
96 | .\" and | |
97 | .\" .I vsmprintf | |
98 | .\" return a pointer to a string of an appropriate length; | |
99 | .\" this pointer should be passed to | |
100 | .\" .I free | |
101 | .\" to release the associated storage | |
102 | .\" when it is no longer needed. | |
103 | .\" If sufficient space is not avaliable, | |
104 | .\" .I smprintf | |
105 | .\" and | |
106 | .\" .I vsmprintf | |
107 | .\" will return | |
108 | .\" .SM | |
ae59e04c CL |
109 | .\" .BR |
110 | .Fn Snprintf | |
411867e7 | 111 | and |
ae59e04c | 112 | .Fn vsnprintf |
411867e7 | 113 | will write at most |
ae59e04c | 114 | .Fa size Ns \-1 |
411867e7 KB |
115 | of the characters printed into the output string |
116 | (the | |
ae59e04c CL |
117 | .Fa size Ns 'th |
118 | character then gets the terminating | |
119 | .Ql \e0 ) ; | |
411867e7 | 120 | if the return value is greater than or equal to the |
ae59e04c | 121 | .Fa size |
411867e7 KB |
122 | argument, the string was too short |
123 | and some of the printed characters were discarded. | |
ae59e04c | 124 | .Fn Sprintf |
df27e01d | 125 | and |
ae59e04c | 126 | .Fn vsprintf |
411867e7 | 127 | effectively assume an infinte |
ae59e04c CL |
128 | .Fa size . |
129 | .Pp | |
130 | The format string is composed of zero or more directives: | |
131 | ordinary | |
132 | .\" multibyte | |
133 | characters (not | |
134 | .Cm % ) , | |
135 | which are copied unchanged to the output stream; | |
136 | and conversion specifications, each of which results | |
137 | in fetching zero or more subsequent arguments. | |
138 | Each conversion specification is introduced by | |
139 | the character | |
140 | .Cm % . | |
141 | The arguments must correspond properly (after type promotion) | |
411867e7 | 142 | with the conversion specifier. |
ae59e04c CL |
143 | After the |
144 | .Cm % , | |
145 | the following appear in sequence: | |
146 | .Bl -bullet | |
147 | .It | |
a2f1db91 | 148 | Zero or more of the following flags: |
ae59e04c CL |
149 | .Bl -hyphen -offset indent |
150 | .It | |
151 | a | |
152 | .Cm # | |
153 | character | |
ef8094b4 KM |
154 | specifying that the value should be converted to an ``alternate form''. |
155 | For | |
ae59e04c CL |
156 | .Cm c , |
157 | .Cm d , | |
158 | .Cm i , | |
159 | .Cm n , | |
160 | .Cm p , | |
161 | .Cm s , | |
ef8094b4 | 162 | and |
ae59e04c | 163 | .Cm u , |
df27e01d KB |
164 | conversions, this option has no effect. |
165 | For | |
ae59e04c | 166 | .Cm o |
ef8094b4 | 167 | conversions, the precision of the number is increased to force the first |
df27e01d KB |
168 | character of the output string to a zero (except if a zero value is printed |
169 | with an explicit precision of zero). | |
170 | For | |
ae59e04c | 171 | .Cm x |
df27e01d | 172 | and |
ae59e04c | 173 | .Cm X |
df27e01d | 174 | conversions, a non-zero result has the string |
ae59e04c | 175 | .Ql 0x |
df27e01d | 176 | (or |
ae59e04c | 177 | .Ql 0X |
df27e01d | 178 | for |
ae59e04c | 179 | .Cm X |
df27e01d KB |
180 | conversions) prepended to it. |
181 | For | |
ae59e04c CL |
182 | .Cm e , |
183 | .Cm E , | |
184 | .Cm f , | |
185 | .Cm g , | |
ef8094b4 | 186 | and |
ae59e04c | 187 | .Cm G , |
ef8094b4 | 188 | conversions, the result will always contain a decimal point, even if no |
df27e01d KB |
189 | digits follow it (normally, a decimal point appears in the results of |
190 | those conversions only if a digit follows). | |
191 | For | |
ae59e04c | 192 | .Cm g |
ef8094b4 | 193 | and |
ae59e04c | 194 | .Cm G |
ef8094b4 | 195 | conversions, trailing zeros are not removed from the result as they |
df27e01d | 196 | would otherwise be. |
ae59e04c CL |
197 | .It |
198 | A zero | |
199 | .Sq Cm \&0 | |
200 | character specifying zero padding. | |
df27e01d | 201 | For all conversions except |
ae59e04c | 202 | .Cm n , |
df27e01d | 203 | the converted value is padded on the left with zeros rather than blanks. |
411867e7 | 204 | If a precision is given with a numeric conversion |
ae59e04c CL |
205 | .Pf ( Mc d , |
206 | .Cm i , | |
207 | .Cm o , | |
208 | .Cm u , | |
209 | .Cm i , | |
210 | .Cm x , | |
df27e01d | 211 | and |
ae59e04c CL |
212 | .Cm X ) , |
213 | the | |
214 | .Sq Cm \&0 | |
215 | flag is ignored. | |
216 | .It | |
217 | A negative field width flag | |
218 | .Sq Cm \- | |
219 | indicates the converted value is to be left adjusted on the field boundary. | |
df27e01d | 220 | Except for |
ae59e04c | 221 | .Cm n |
df27e01d KB |
222 | conversions, the converted value is padded on the right with blanks, |
223 | rather than on the left with blanks or zeros. | |
ae59e04c CL |
224 | A |
225 | .Sq Cm \- | |
226 | overrides a | |
227 | .Sq Cm \&0 | |
228 | if both are given. | |
229 | .It | |
df27e01d | 230 | A space, specifying that a blank should be left before a positive number |
411867e7 | 231 | produced by a signed conversion |
ae59e04c CL |
232 | .Pf ( Cm d , |
233 | .Cm e , | |
234 | .Cm E , | |
235 | .Cm f , | |
236 | .Cm g , | |
237 | .Cm G , | |
df27e01d | 238 | or |
ae59e04c CL |
239 | .Cm i ) . |
240 | .It | |
241 | a | |
242 | .Sq Cm + | |
243 | character specifying that a sign always be placed before a | |
df27e01d | 244 | number produced by a signed conversion. |
ae59e04c CL |
245 | A |
246 | .Sq Cm + | |
247 | overrides a space if both are used. | |
248 | .El | |
249 | .It | |
250 | An optional decimal digit string specifying a minimum field width. | |
df27e01d | 251 | If the converted value has fewer characters than the field width, it will |
ae59e04c CL |
252 | be padded with spaces on the left (or right, if the left-adjustment |
253 | flag has been given) to fill out | |
254 | the field width. | |
255 | .It | |
256 | An optional precision, in the form of a period | |
257 | .Sq Cm \&. | |
258 | followed by an | |
df27e01d KB |
259 | optional digit string. If the digit string is omitted, the precision |
260 | is taken as zero. This gives the minimum number of digits to appear for | |
ae59e04c CL |
261 | .Cm d , |
262 | .Cm i , | |
263 | .Cm o , | |
264 | .Cm u , | |
265 | .Cm x , | |
df27e01d | 266 | and |
ae59e04c CL |
267 | .Cm X |
268 | conversions, the number of digits to appear after the decimal-point for | |
269 | .Cm e , | |
270 | .Cm E , | |
df27e01d | 271 | and |
ae59e04c | 272 | .Cm f |
df27e01d | 273 | conversions, the maximum number of significant digits for |
ae59e04c | 274 | .Cm g |
df27e01d | 275 | and |
ae59e04c | 276 | .Cm G |
df27e01d KB |
277 | conversions, or the maximum number of characters to be printed from a |
278 | string for | |
ae59e04c | 279 | .Cm s |
df27e01d | 280 | conversions. |
ae59e04c CL |
281 | .It |
282 | The optional character | |
283 | .Cm h , | |
c3ce85c3 | 284 | specifying that a following |
ae59e04c CL |
285 | .Cm d , |
286 | .Cm i , | |
287 | .Cm o , | |
288 | .Cm u , | |
289 | .Cm x , | |
c3ce85c3 | 290 | or |
ae59e04c | 291 | .Cm X |
df27e01d | 292 | conversion corresponds to a |
ae59e04c | 293 | .Em short int |
df27e01d | 294 | or |
ae59e04c | 295 | .Em unsigned short int |
df27e01d | 296 | argument, or that a following |
ae59e04c | 297 | .Cm n |
df27e01d | 298 | conversion corresponds to a pointer to a |
ae59e04c | 299 | .Em short int |
df27e01d | 300 | argument. |
ae59e04c CL |
301 | .It |
302 | The optional character | |
303 | .Cm l | |
df27e01d | 304 | (ell) specifying that a following |
ae59e04c CL |
305 | .Cm d , |
306 | .Cm i , | |
307 | .Cm o , | |
308 | .Cm u , | |
309 | .Cm x , | |
a2f1db91 | 310 | or |
ae59e04c CL |
311 | .Cm X |
312 | conversion applies to a pointer to a | |
313 | .Em long int | |
df27e01d | 314 | or |
ae59e04c | 315 | .Em unsigned long int |
df27e01d | 316 | argument, or that a following |
ae59e04c | 317 | .Cm n |
df27e01d | 318 | conversion corresponds to a pointer to a |
ae59e04c | 319 | .Em long int |
df27e01d | 320 | argument. |
ae59e04c | 321 | .It |
df27e01d | 322 | The character |
ae59e04c | 323 | .Cm L |
df27e01d | 324 | specifying that a following |
ae59e04c CL |
325 | .Cm e , |
326 | .Cm E , | |
327 | .Cm f , | |
328 | .Cm g , | |
df27e01d | 329 | or |
ae59e04c | 330 | .Cm G |
df27e01d | 331 | conversion corresponds to a |
ae59e04c | 332 | .Em long double |
df27e01d | 333 | argument (but note that long double values are not currently supported |
ae59e04c CL |
334 | by the |
335 | .Tn VAX | |
336 | and | |
337 | .Tn Tahoe | |
338 | compilers). | |
339 | .It | |
340 | A character that specifies the type of conversion to be applied. | |
341 | .El | |
342 | .Pp | |
343 | A field width or precision, or both, may be indicated by | |
344 | an asterisk | |
345 | .Ql * | |
346 | instead of a | |
df27e01d | 347 | digit string. |
ae59e04c CL |
348 | In this case, an |
349 | .Em int | |
350 | argument supplies the field width or precision. | |
df27e01d KB |
351 | A negative field width is treated as a left adjustment flag followed by a |
352 | positive field width; a negative precision is treated as though it were | |
353 | missing. | |
ae59e04c CL |
354 | .Pp |
355 | The conversion specifiers and their meanings are: | |
356 | .Bl -tag -width "diouxX" | |
357 | .It Cm diouxX | |
df27e01d | 358 | The |
ae59e04c | 359 | .Em int |
df27e01d | 360 | (or appropriate variant) argument is converted to signed decimal |
ae59e04c CL |
361 | .Pf ( Cm d |
362 | and | |
363 | .Cm i ) , | |
df27e01d | 364 | unsigned octal |
ae59e04c | 365 | .Pq Cm o , |
df27e01d | 366 | unsigned decimal |
ae59e04c | 367 | .Pq Cm u , |
df27e01d | 368 | or unsigned hexadecimal |
ae59e04c CL |
369 | .Pf ( Cm x |
370 | and | |
371 | .Cm X ) | |
372 | notation. The letters | |
373 | .Cm abcdef | |
df27e01d | 374 | are used for |
ae59e04c | 375 | .Cm x |
df27e01d | 376 | conversions; the letters |
ae59e04c | 377 | .Cm ABCDEF |
df27e01d | 378 | are used for |
ae59e04c | 379 | .m X |
df27e01d KB |
380 | conversions. |
381 | The precision, if any, gives the minimum number of digits that must | |
382 | appear; if the converted value requires fewer digits, it is padded on | |
383 | the left with zeros. | |
ae59e04c | 384 | .It Cm DOU |
df27e01d | 385 | The |
ae59e04c | 386 | .Em long int |
df27e01d KB |
387 | argument is converted to signed decimal, unsigned octal, or unsigned |
388 | decimal, as if the format had been | |
ae59e04c CL |
389 | .Cm ld , |
390 | .Cm lo , | |
df27e01d | 391 | or |
ae59e04c | 392 | .Cm lu |
df27e01d KB |
393 | respectively. |
394 | These conversion characters are deprecated, and will eventually disappear. | |
ae59e04c | 395 | .It Cm eE |
df27e01d | 396 | The |
ae59e04c | 397 | .Em double |
df27e01d | 398 | argument is rounded and converted in the style |
ae59e04c CL |
399 | .Sm off |
400 | .Pf [\-]d Cm \&. No ddd Cm e No \\*(Pmdd | |
401 | .Sm on | |
402 | where there is one digit before the | |
403 | decimal-point character | |
404 | and the number of digits after it is equal to the precision; | |
405 | if the precision is missing, | |
406 | it is taken as 6; if the precision is | |
407 | zero, no decimal-point character appears. | |
df27e01d | 408 | An |
ae59e04c | 409 | .Cm E |
df27e01d | 410 | conversion uses the letter |
ae59e04c | 411 | .Cm E |
df27e01d | 412 | (rather than |
ae59e04c | 413 | .Cm e ) |
df27e01d KB |
414 | to introduce the exponent. |
415 | The exponent always contains at least two digits; if the value is zero, | |
416 | the exponent is 00. | |
ae59e04c | 417 | .It Cm f |
df27e01d | 418 | The |
ae59e04c | 419 | .Em double |
df27e01d | 420 | argument is rounded and converted to decimal notation in the style |
ae59e04c CL |
421 | .Sm off |
422 | .Pf [-]ddd Cm \&. No ddd , | |
423 | .Sm on | |
424 | where the number of digits after the decimal-point character | |
425 | is equal to the precision specification. | |
426 | If the precision is missing, it is taken as 6; if the precision is | |
427 | explicitly zero, no decimal-point character appears. | |
df27e01d | 428 | If a decimal point appears, at least one digit appears before it. |
ae59e04c | 429 | .It Cm g |
df27e01d | 430 | The |
ae59e04c CL |
431 | .Em double |
432 | argument is converted in style | |
433 | .Cm f | |
df27e01d | 434 | or |
ae59e04c | 435 | .Cm e |
df27e01d | 436 | (or |
ae59e04c | 437 | .Cm E |
df27e01d | 438 | for |
ae59e04c | 439 | .Cm G |
df27e01d KB |
440 | conversions). |
441 | The precision specifies the number of significant digits. | |
442 | If the precision is missing, 6 digits are given; if the precision is zero, | |
443 | it is treated as 1. | |
444 | Style | |
ae59e04c | 445 | .Cm e |
df27e01d KB |
446 | is used if the exponent from its conversion is less than -4 or greater than |
447 | or equal to the precision. | |
448 | Trailing zeros are removed from the fractional part of the result; a | |
449 | decimal point appears only if it is followed by at least one digit. | |
ae59e04c | 450 | .It Cm c |
df27e01d | 451 | The |
ae59e04c | 452 | .Em int |
df27e01d | 453 | argument is converted to an |
ae59e04c CL |
454 | .Em unsigned char , |
455 | and the resulting character is written. | |
456 | .It Cm s | |
df27e01d | 457 | The |
ae59e04c CL |
458 | .Dq Em char * |
459 | argument is expected to be a pointer to an array of character type (pointer | |
460 | to a string). | |
461 | Characters from the array are written up to (but not including) | |
462 | a terminating | |
463 | .Dv NUL | |
464 | character; | |
465 | if a precision is specified, no more than the number specified are | |
466 | written. | |
467 | If a precision is given, no null character | |
468 | need be present; if the precision is not specified, or is greater than | |
469 | the size of the array, the array must contain a terminating | |
470 | .Dv NUL | |
471 | character. | |
472 | .It Cm p | |
df27e01d | 473 | The |
ae59e04c CL |
474 | .Dq Em void * |
475 | pointer argument is printed in hexadecimal (as if by | |
476 | .Ql %#x | |
477 | or | |
478 | .Ql %#lx ) . | |
479 | .It Cm n | |
df27e01d KB |
480 | The number of characters written so far is stored into the |
481 | integer indicated by the | |
ae59e04c | 482 | .Dq Em int * |
df27e01d KB |
483 | (or variant) pointer argument. |
484 | No argument is converted. | |
ae59e04c CL |
485 | .It Cm % |
486 | A | |
487 | .Ql % | |
488 | is written. No argument is converted. The complete conversion specification | |
489 | is | |
490 | .Ql %% . | |
491 | .El | |
492 | .Pp | |
df27e01d KB |
493 | In no case does a non-existent or small field width cause truncation of |
494 | a field; if the result of a conversion is wider than the field width, the | |
ae59e04c CL |
495 | field is expanded to contain the conversion result. |
496 | .Pp | |
497 | .Sh EXAMPLES | |
c3ce85c3 KM |
498 | .br |
499 | To print a date and time in the form `Sunday, July 3, 10:02', | |
500 | where | |
ae59e04c | 501 | .Em weekday |
c3ce85c3 | 502 | and |
ae59e04c CL |
503 | .Em month |
504 | are pointers to strings: | |
505 | .Bd -literal -offset indent | |
506 | #include <stdio.h> | |
108b3140 | 507 | fprintf(stdout, "%s, %s %d, %.2d:%.2d\en", |
ae59e04c CL |
508 | weekday, month, day, hour, min); |
509 | .Ed | |
510 | .Pp | |
511 | To print \*(Pi | |
512 | to five decimal places: | |
513 | .Bd -literal -offset indent | |
514 | #include <math.h> | |
515 | #include <stdio.h> | |
108b3140 | 516 | fprintf(stdout, "pi = %.5f\en", 4 * atan(1.0)); |
ae59e04c CL |
517 | .Ed |
518 | .Pp | |
df27e01d | 519 | To allocate a 128 byte string and print into it: |
ae59e04c | 520 | .Bd -literal -offset indent |
df27e01d | 521 | #include <stdio.h> |
108b3140 DS |
522 | #include <stdlib.h> |
523 | #include <stdarg.h> | |
524 | char *newfmt(const char *fmt, ...) | |
df27e01d | 525 | { |
108b3140 | 526 | char *p; |
ae59e04c CL |
527 | va_list ap; |
528 | if ((p = malloc(128)) == NULL) | |
529 | return (NULL); | |
108b3140 DS |
530 | va_start(ap, fmt); |
531 | (void) vsnprintf(p, 128, fmt, ap); | |
ae59e04c CL |
532 | va_end(ap); |
533 | return (p); | |
df27e01d | 534 | } |
ae59e04c CL |
535 | .Ed |
536 | .Sh SEE ALSO | |
537 | .Xr printf 1 , | |
538 | .Xr scanf 3 | |
539 | .Sh STANDARDS | |
108b3140 | 540 | The |
ae59e04c CL |
541 | .Fn fprintf , |
542 | .Fn printf , | |
543 | .Fn sprintf , | |
ae59e04c CL |
544 | .Fn vprintf , |
545 | .Fn vfprintf , | |
ae59e04c | 546 | and |
108b3140 | 547 | .Fn vsprintf |
ae59e04c CL |
548 | functions |
549 | conform to | |
550 | .St -ansiC . | |
108b3140 DS |
551 | .Sh HISTORY |
552 | The functions | |
553 | .Fn snprintf | |
554 | and | |
555 | .Fn vsnprintf | |
556 | are new to this release. | |
ae59e04c CL |
557 | .Sh BUGS |
558 | The conversion formats | |
559 | .Cm %D , | |
560 | .Cm %O , | |
561 | and | |
562 | .Cm %U | |
563 | are not standard and | |
df27e01d | 564 | are provided only for backward compatibility. |
ae59e04c CL |
565 | The effect of padding the |
566 | .Cm %p | |
567 | format with zeros (either by the | |
568 | .Sq Cm 0 | |
df27e01d | 569 | flag or by specifying a precision), and the benign effect (i.e., none) |
ae59e04c CL |
570 | of the |
571 | .Sq Cm # | |
572 | flag on | |
573 | .Cm %n | |
574 | and | |
575 | .Cm %p | |
576 | conversions, as well as other | |
577 | nonsensical combinations such as | |
578 | .Cm %Ld , | |
579 | are not standard; such combinations | |
df27e01d | 580 | should be avoided. |
ae59e04c | 581 | .Pp |
411867e7 | 582 | Because |
ae59e04c | 583 | .Fn sprintf |
411867e7 | 584 | and |
ae59e04c | 585 | .Fn vsprintf |
411867e7 KB |
586 | assume an infinitely long string, |
587 | callers must be careful not to overflow the actual space; | |
588 | this is often impossible to assure. | |
589 | For safety, programmers should use the | |
ae59e04c | 590 | .Fn snprintf |
411867e7 KB |
591 | interface instead. |
592 | Unfortunately, this interface is not portable. |