| 1 |
# SOME DESCRIPTIVE TITLE |
| 2 |
# Copyright (C) YEAR Free Software Foundation, Inc. |
| 3 |
# This file is distributed under the same license as the PACKAGE package. |
| 4 |
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR. |
| 5 |
# |
| 6 |
#, fuzzy |
| 7 |
msgid "" |
| 8 |
msgstr "" |
| 9 |
"Project-Id-Version: PACKAGE VERSION\n" |
| 10 |
"POT-Creation-Date: 2026-06-05 06:43+0200\n" |
| 11 |
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" |
| 12 |
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" |
| 13 |
"Language-Team: LANGUAGE <[email protected]>\n" |
| 14 |
"Language: \n" |
| 15 |
"MIME-Version: 1.0\n" |
| 16 |
"Content-Type: text/plain; charset=UTF-8\n" |
| 17 |
"Content-Transfer-Encoding: 8bit\n" |
| 18 |
|
| 19 |
#. type: TH |
| 20 |
#: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1 |
| 21 |
#: opensuse-tumbleweed |
| 22 |
#, no-wrap |
| 23 |
msgid "snprintf" |
| 24 |
msgstr "" |
| 25 |
|
| 26 |
#. type: TH |
| 27 |
#: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1 |
| 28 |
#: opensuse-tumbleweed |
| 29 |
#, no-wrap |
| 30 |
msgid "2025-12-07" |
| 31 |
msgstr "" |
| 32 |
|
| 33 |
#. type: TH |
| 34 |
#: archlinux debian-unstable |
| 35 |
#, no-wrap |
| 36 |
msgid "Linux man-pages 6.18" |
| 37 |
msgstr "" |
| 38 |
|
| 39 |
#. type: SH |
| 40 |
#: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1 |
| 41 |
#: opensuse-tumbleweed |
| 42 |
#, no-wrap |
| 43 |
msgid "NAME" |
| 44 |
msgstr "" |
| 45 |
|
| 46 |
#. type: Plain text |
| 47 |
#: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1 |
| 48 |
#: opensuse-tumbleweed |
| 49 |
msgid "snprintf, vsnprintf - string print formatted" |
| 50 |
msgstr "" |
| 51 |
|
| 52 |
#. type: SH |
| 53 |
#: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1 |
| 54 |
#: opensuse-tumbleweed |
| 55 |
#, no-wrap |
| 56 |
msgid "LIBRARY" |
| 57 |
msgstr "" |
| 58 |
|
| 59 |
#. type: Plain text |
| 60 |
#: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1 |
| 61 |
#: opensuse-tumbleweed |
| 62 |
msgid "Standard C library (I<libc>,\\ I<-lc>)" |
| 63 |
msgstr "" |
| 64 |
|
| 65 |
#. type: SH |
| 66 |
#: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1 |
| 67 |
#: opensuse-tumbleweed |
| 68 |
#, no-wrap |
| 69 |
msgid "SYNOPSIS" |
| 70 |
msgstr "" |
| 71 |
|
| 72 |
#. type: Plain text |
| 73 |
#: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1 |
| 74 |
#: opensuse-tumbleweed |
| 75 |
#, no-wrap |
| 76 |
msgid "B<#include E<lt>stdio.hE<gt>>\n" |
| 77 |
msgstr "" |
| 78 |
|
| 79 |
#. type: Plain text |
| 80 |
#: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1 |
| 81 |
#: opensuse-tumbleweed |
| 82 |
#, no-wrap |
| 83 |
msgid "" |
| 84 |
"B<int snprintf(>size_t size;\n" |
| 85 |
"B< char >I<str>B<[restrict >I<size>B<], size_t >I<size>B<,>\n" |
| 86 |
"B< const char *restrict >I<format>B<, ...);>\n" |
| 87 |
"B<int vsnprintf(>size_t size;\n" |
| 88 |
"B< char >I<str>B<[restrict >I<size>B<], size_t >I<size>B<,>\n" |
| 89 |
"B< const char *restrict >I<format>B<, va_list >I<ap>B<);>\n" |
| 90 |
msgstr "" |
| 91 |
|
| 92 |
#. type: Plain text |
| 93 |
#: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1 |
| 94 |
#: opensuse-tumbleweed |
| 95 |
msgid "" |
| 96 |
"Feature Test Macro Requirements for glibc (see B<feature_test_macros>(7)):" |
| 97 |
msgstr "" |
| 98 |
|
| 99 |
#. type: Plain text |
| 100 |
#: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1 |
| 101 |
#: opensuse-tumbleweed |
| 102 |
msgid "B<snprintf>(), B<vsnprintf>():" |
| 103 |
msgstr "" |
| 104 |
|
| 105 |
#. type: Plain text |
| 106 |
#: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1 |
| 107 |
#: opensuse-tumbleweed |
| 108 |
#, no-wrap |
| 109 |
msgid "" |
| 110 |
" _XOPEN_SOURCE E<gt>= 500 || _ISOC99_SOURCE\n" |
| 111 |
" || /* glibc E<lt>= 2.19: */ _BSD_SOURCE\n" |
| 112 |
msgstr "" |
| 113 |
|
| 114 |
#. type: SH |
| 115 |
#: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1 |
| 116 |
#: opensuse-tumbleweed |
| 117 |
#, no-wrap |
| 118 |
msgid "DESCRIPTION" |
| 119 |
msgstr "" |
| 120 |
|
| 121 |
#. type: Plain text |
| 122 |
#: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1 |
| 123 |
#: opensuse-tumbleweed |
| 124 |
msgid "" |
| 125 |
"These functions are similar to B<printf>(3), except that they write to the " |
| 126 |
"character string I<str> instead of a stream." |
| 127 |
msgstr "" |
| 128 |
|
| 129 |
#. type: Plain text |
| 130 |
#: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1 |
| 131 |
#: opensuse-tumbleweed |
| 132 |
msgid "" |
| 133 |
"The functions B<snprintf>() and B<vsnprintf>() write at most I<size> bytes " |
| 134 |
"(including the terminating null byte (\\[aq]\\[rs]0\\[aq])) to I<str>." |
| 135 |
msgstr "" |
| 136 |
|
| 137 |
#. type: Plain text |
| 138 |
#: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1 |
| 139 |
#: opensuse-tumbleweed |
| 140 |
msgid "" |
| 141 |
"B<vsnprintf>() is equivalent to B<snprintf>(), except that it is called " |
| 142 |
"with a I<va_list> instead of a variable number of arguments. This function " |
| 143 |
"does not call the I<va_end> macro. Because it invokes the I<va_arg> macro, " |
| 144 |
"the value of I<ap> is undefined after the call. See B<stdarg>(3)." |
| 145 |
msgstr "" |
| 146 |
|
| 147 |
#. type: Plain text |
| 148 |
#: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1 |
| 149 |
#: opensuse-tumbleweed |
| 150 |
msgid "" |
| 151 |
"C99 and POSIX.1-2001 specify that the results are undefined if a call to " |
| 152 |
"B<snprintf>() or B<vsnprintf>() would cause copying to take place between " |
| 153 |
"objects that overlap (e.g., if the target string array and one of the " |
| 154 |
"supplied input arguments refer to the same buffer). See CAVEATS." |
| 155 |
msgstr "" |
| 156 |
|
| 157 |
#. type: SS |
| 158 |
#: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1 |
| 159 |
#: opensuse-tumbleweed |
| 160 |
#, no-wrap |
| 161 |
msgid "Format of the format string" |
| 162 |
msgstr "" |
| 163 |
|
| 164 |
#. type: Plain text |
| 165 |
#: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1 |
| 166 |
#: opensuse-tumbleweed |
| 167 |
msgid "See B<printf>(3)." |
| 168 |
msgstr "" |
| 169 |
|
| 170 |
#. type: SH |
| 171 |
#: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1 |
| 172 |
#: opensuse-tumbleweed |
| 173 |
#, no-wrap |
| 174 |
msgid "RETURN VALUE" |
| 175 |
msgstr "" |
| 176 |
|
| 177 |
#. type: Plain text |
| 178 |
#: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1 |
| 179 |
#: opensuse-tumbleweed |
| 180 |
msgid "" |
| 181 |
"Upon successful return, these functions return the number of bytes printed " |
| 182 |
"(excluding the null byte used to end output to strings)." |
| 183 |
msgstr "" |
| 184 |
|
| 185 |
#. type: Plain text |
| 186 |
#: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1 |
| 187 |
#: opensuse-tumbleweed |
| 188 |
msgid "" |
| 189 |
"The functions B<snprintf>() and B<vsnprintf>() do not write more than " |
| 190 |
"I<size> bytes (including the terminating null byte (\\[aq]\\[rs]0\\[aq])). " |
| 191 |
"If the output was truncated due to this limit, then the return value is the " |
| 192 |
"number of characters (excluding the terminating null byte) which would have " |
| 193 |
"been written to the final string if enough space had been available. Thus, " |
| 194 |
"a return value of I<size> or more means that the output was truncated. (See " |
| 195 |
"also below under CAVEATS.)" |
| 196 |
msgstr "" |
| 197 |
|
| 198 |
#. type: Plain text |
| 199 |
#: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1 |
| 200 |
#: opensuse-tumbleweed |
| 201 |
msgid "" |
| 202 |
"On error, a negative value is returned, and I<errno> is set to indicate the " |
| 203 |
"error." |
| 204 |
msgstr "" |
| 205 |
|
| 206 |
#. type: SH |
| 207 |
#: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1 |
| 208 |
#: opensuse-tumbleweed |
| 209 |
#, no-wrap |
| 210 |
msgid "ERRORS" |
| 211 |
msgstr "" |
| 212 |
|
| 213 |
#. type: SH |
| 214 |
#: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1 |
| 215 |
#: opensuse-tumbleweed |
| 216 |
#, no-wrap |
| 217 |
msgid "ATTRIBUTES" |
| 218 |
msgstr "" |
| 219 |
|
| 220 |
#. type: Plain text |
| 221 |
#: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1 |
| 222 |
#: opensuse-tumbleweed |
| 223 |
msgid "" |
| 224 |
"For an explanation of the terms used in this section, see B<attributes>(7)." |
| 225 |
msgstr "" |
| 226 |
|
| 227 |
#. type: tbl table |
| 228 |
#: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1 |
| 229 |
#: opensuse-tumbleweed |
| 230 |
#, no-wrap |
| 231 |
msgid "Interface" |
| 232 |
msgstr "" |
| 233 |
|
| 234 |
#. type: tbl table |
| 235 |
#: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1 |
| 236 |
#: opensuse-tumbleweed |
| 237 |
#, no-wrap |
| 238 |
msgid "Attribute" |
| 239 |
msgstr "" |
| 240 |
|
| 241 |
#. type: tbl table |
| 242 |
#: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1 |
| 243 |
#: opensuse-tumbleweed |
| 244 |
#, no-wrap |
| 245 |
msgid "Value" |
| 246 |
msgstr "" |
| 247 |
|
| 248 |
#. type: tbl table |
| 249 |
#: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1 |
| 250 |
#: opensuse-tumbleweed |
| 251 |
#, no-wrap |
| 252 |
msgid ".na\n" |
| 253 |
msgstr "" |
| 254 |
|
| 255 |
#. type: tbl table |
| 256 |
#: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1 |
| 257 |
#: opensuse-tumbleweed |
| 258 |
#, no-wrap |
| 259 |
msgid ".nh\n" |
| 260 |
msgstr "" |
| 261 |
|
| 262 |
#. type: tbl table |
| 263 |
#: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1 |
| 264 |
#: opensuse-tumbleweed |
| 265 |
#, no-wrap |
| 266 |
msgid "" |
| 267 |
"B<snprintf>(),\n" |
| 268 |
"B<vsnprintf>()" |
| 269 |
msgstr "" |
| 270 |
|
| 271 |
#. type: tbl table |
| 272 |
#: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1 |
| 273 |
#: opensuse-tumbleweed |
| 274 |
#, no-wrap |
| 275 |
msgid "Thread safety" |
| 276 |
msgstr "" |
| 277 |
|
| 278 |
#. type: tbl table |
| 279 |
#: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1 |
| 280 |
#: opensuse-tumbleweed |
| 281 |
#, no-wrap |
| 282 |
msgid "MT-Safe locale" |
| 283 |
msgstr "" |
| 284 |
|
| 285 |
#. type: SH |
| 286 |
#: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1 |
| 287 |
#: opensuse-tumbleweed |
| 288 |
#, no-wrap |
| 289 |
msgid "STANDARDS" |
| 290 |
msgstr "" |
| 291 |
|
| 292 |
#. type: Plain text |
| 293 |
#: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1 |
| 294 |
#: opensuse-tumbleweed |
| 295 |
msgid "C11, POSIX.1-2008." |
| 296 |
msgstr "" |
| 297 |
|
| 298 |
#. type: SH |
| 299 |
#: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1 |
| 300 |
#: opensuse-tumbleweed |
| 301 |
#, no-wrap |
| 302 |
msgid "HISTORY" |
| 303 |
msgstr "" |
| 304 |
|
| 305 |
#. type: Plain text |
| 306 |
#: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1 |
| 307 |
#: opensuse-tumbleweed |
| 308 |
msgid "SUSv2, C99, POSIX.1-2001." |
| 309 |
msgstr "" |
| 310 |
|
| 311 |
#. type: Plain text |
| 312 |
#: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1 |
| 313 |
#: opensuse-tumbleweed |
| 314 |
msgid "" |
| 315 |
"Concerning the return value, SUSv2 and C99 contradict each other: when " |
| 316 |
"B<snprintf>() is called with I<size>=0 then SUSv2 stipulates an unspecified " |
| 317 |
"return value less than 1, while C99 allows I<str> to be NULL in this case, " |
| 318 |
"and gives the return value (as always) as the number of characters that " |
| 319 |
"would have been written in case the output string has been large enough. " |
| 320 |
"POSIX.1-2001 and later align their specification of B<snprintf>() with C99." |
| 321 |
msgstr "" |
| 322 |
|
| 323 |
#. type: SH |
| 324 |
#: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1 |
| 325 |
#: opensuse-tumbleweed |
| 326 |
#, no-wrap |
| 327 |
msgid "CAVEATS" |
| 328 |
msgstr "" |
| 329 |
|
| 330 |
#. type: Plain text |
| 331 |
#: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1 |
| 332 |
#: opensuse-tumbleweed |
| 333 |
msgid "Some programs imprudently rely on code such as the following" |
| 334 |
msgstr "" |
| 335 |
|
| 336 |
#. type: Plain text |
| 337 |
#: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1 |
| 338 |
#: opensuse-tumbleweed |
| 339 |
#, no-wrap |
| 340 |
msgid "snprintf(buf, countof(buf), \"%s some further text\", buf);\n" |
| 341 |
msgstr "" |
| 342 |
|
| 343 |
#. http://sourceware.org/bugzilla/show_bug.cgi?id=7075 |
| 344 |
#. type: Plain text |
| 345 |
#: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1 |
| 346 |
#: opensuse-tumbleweed |
| 347 |
msgid "" |
| 348 |
"to append text to I<buf>. However, the standards explicitly note that the " |
| 349 |
"results are undefined if source and destination buffers overlap when calling " |
| 350 |
"B<snprintf>() and B<vsnprintf>(). Depending on the version of B<gcc>(1) " |
| 351 |
"used, and the compiler options employed, calls such as the above will B<not> " |
| 352 |
"produce the expected results." |
| 353 |
msgstr "" |
| 354 |
|
| 355 |
#. .SH HISTORY |
| 356 |
#. UNIX V7 defines the three routines |
| 357 |
#. .BR sprintf (). |
| 358 |
#. 2.11BSD has |
| 359 |
#. .BR vsprintf (). |
| 360 |
#. 4.4BSD introduces the functions |
| 361 |
#. .BR snprintf () |
| 362 |
#. and |
| 363 |
#. .BR vsnprintf (). |
| 364 |
#. FreeBSD also has functions |
| 365 |
#. .BR asprintf () |
| 366 |
#. and |
| 367 |
#. .BR vasprintf (), |
| 368 |
#. that allocate a buffer large enough for |
| 369 |
#. .BR sprintf (). |
| 370 |
#. type: Plain text |
| 371 |
#: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1 |
| 372 |
#: opensuse-tumbleweed |
| 373 |
msgid "" |
| 374 |
"The glibc implementation of the functions B<snprintf>() and B<vsnprintf>() " |
| 375 |
"conforms to the C99 standard, that is, behaves as described above, since " |
| 376 |
"glibc 2.1. Until glibc 2.0.6, they would return -1 when the output was " |
| 377 |
"truncated." |
| 378 |
msgstr "" |
| 379 |
|
| 380 |
#. type: SH |
| 381 |
#: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1 |
| 382 |
#: opensuse-tumbleweed |
| 383 |
#, no-wrap |
| 384 |
msgid "BUGS" |
| 385 |
msgstr "" |
| 386 |
|
| 387 |
#. type: SH |
| 388 |
#: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1 |
| 389 |
#: opensuse-tumbleweed |
| 390 |
#, no-wrap |
| 391 |
msgid "EXAMPLES" |
| 392 |
msgstr "" |
| 393 |
|
| 394 |
#. type: Plain text |
| 395 |
#: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1 |
| 396 |
#: opensuse-tumbleweed |
| 397 |
msgid "" |
| 398 |
"To allocate a sufficiently large string and print into it (code correct for " |
| 399 |
"both glibc 2.0 and glibc 2.1):" |
| 400 |
msgstr "" |
| 401 |
|
| 402 |
#. type: Plain text |
| 403 |
#: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1 |
| 404 |
#: opensuse-tumbleweed |
| 405 |
#, no-wrap |
| 406 |
msgid "" |
| 407 |
"#include E<lt>stdio.hE<gt>\n" |
| 408 |
"#include E<lt>stdlib.hE<gt>\n" |
| 409 |
"#include E<lt>stdarg.hE<gt>\n" |
| 410 |
"\\&\n" |
| 411 |
"char *\n" |
| 412 |
"make_message(const char *fmt, ...)\n" |
| 413 |
"{\n" |
| 414 |
" int n = 0;\n" |
| 415 |
" size_t size = 0;\n" |
| 416 |
" char *p = NULL;\n" |
| 417 |
" va_list ap;\n" |
| 418 |
"\\&\n" |
| 419 |
" /* Determine required size. */\n" |
| 420 |
"\\&\n" |
| 421 |
" va_start(ap, fmt);\n" |
| 422 |
" n = vsnprintf(p, size, fmt, ap);\n" |
| 423 |
" va_end(ap);\n" |
| 424 |
"\\&\n" |
| 425 |
" if (n E<lt> 0)\n" |
| 426 |
" return NULL;\n" |
| 427 |
"\\&\n" |
| 428 |
" size = (size_t) n + 1; /* One extra byte for \\[aq]\\[rs]0\\[aq] */\n" |
| 429 |
" p = malloc(size);\n" |
| 430 |
" if (p == NULL)\n" |
| 431 |
" return NULL;\n" |
| 432 |
"\\&\n" |
| 433 |
" va_start(ap, fmt);\n" |
| 434 |
" n = vsnprintf(p, size, fmt, ap);\n" |
| 435 |
" va_end(ap);\n" |
| 436 |
"\\&\n" |
| 437 |
" if (n E<lt> 0) {\n" |
| 438 |
" free(p);\n" |
| 439 |
" return NULL;\n" |
| 440 |
" }\n" |
| 441 |
"\\&\n" |
| 442 |
" return p;\n" |
| 443 |
"}\n" |
| 444 |
msgstr "" |
| 445 |
|
| 446 |
#. type: Plain text |
| 447 |
#: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1 |
| 448 |
#: opensuse-tumbleweed |
| 449 |
msgid "" |
| 450 |
"If truncation occurs in glibc versions prior to glibc 2.0.6, this is treated " |
| 451 |
"as an error instead of being handled gracefully." |
| 452 |
msgstr "" |
| 453 |
|
| 454 |
#. type: SH |
| 455 |
#: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1 |
| 456 |
#: opensuse-tumbleweed |
| 457 |
#, no-wrap |
| 458 |
msgid "SEE ALSO" |
| 459 |
msgstr "" |
| 460 |
|
| 461 |
#. type: Plain text |
| 462 |
#: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1 |
| 463 |
#: opensuse-tumbleweed |
| 464 |
msgid "" |
| 465 |
"B<printf>(1), B<asprintf>(3), B<printf>(3), B<puts>(3), B<scanf>(3), " |
| 466 |
"B<setlocale>(3), B<strfromd>(3), B<wcrtomb>(3), B<wprintf>(3), B<locale>(5)" |
| 467 |
msgstr "" |
| 468 |
|
| 469 |
#. type: TH |
| 470 |
#: mageia-cauldron |
| 471 |
#, no-wrap |
| 472 |
msgid "Linux man-pages 6.17" |
| 473 |
msgstr "" |
| 474 |
|
| 475 |
#. type: TH |
| 476 |
#: opensuse-leap-16-1 opensuse-tumbleweed |
| 477 |
#, no-wrap |
| 478 |
msgid "Linux man-pages (unreleased)" |
| 479 |
msgstr "" |