# SOME DESCRIPTIVE TITLE # Copyright (C) YEAR Free Software Foundation, Inc. # This file is distributed under the same license as the PACKAGE package. # FIRST AUTHOR , YEAR. # #, fuzzy msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "POT-Creation-Date: 2026-06-05 06:43+0200\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" "Language: \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" #. type: TH #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1 #: opensuse-tumbleweed #, no-wrap msgid "snprintf" msgstr "" #. type: TH #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1 #: opensuse-tumbleweed #, no-wrap msgid "2025-12-07" msgstr "" #. type: TH #: archlinux debian-unstable #, no-wrap msgid "Linux man-pages 6.18" msgstr "" #. type: SH #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1 #: opensuse-tumbleweed #, no-wrap msgid "NAME" msgstr "" #. type: Plain text #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1 #: opensuse-tumbleweed msgid "snprintf, vsnprintf - string print formatted" msgstr "" #. type: SH #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1 #: opensuse-tumbleweed #, no-wrap msgid "LIBRARY" msgstr "" #. type: Plain text #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1 #: opensuse-tumbleweed msgid "Standard C library (I,\\ I<-lc>)" msgstr "" #. type: SH #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1 #: opensuse-tumbleweed #, no-wrap msgid "SYNOPSIS" msgstr "" #. type: Plain text #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1 #: opensuse-tumbleweed #, no-wrap msgid "B<#include Estdio.hE>\n" msgstr "" #. type: Plain text #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1 #: opensuse-tumbleweed #, no-wrap msgid "" "Bsize_t size;\n" "B< char >IB<[restrict >IB<], size_t >IB<,>\n" "B< const char *restrict >IB<, ...);>\n" "Bsize_t size;\n" "B< char >IB<[restrict >IB<], size_t >IB<,>\n" "B< const char *restrict >IB<, va_list >IB<);>\n" msgstr "" #. type: Plain text #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1 #: opensuse-tumbleweed msgid "" "Feature Test Macro Requirements for glibc (see B(7)):" msgstr "" #. type: Plain text #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1 #: opensuse-tumbleweed msgid "B(), B():" msgstr "" #. type: Plain text #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1 #: opensuse-tumbleweed #, no-wrap msgid "" " _XOPEN_SOURCE E= 500 || _ISOC99_SOURCE\n" " || /* glibc E= 2.19: */ _BSD_SOURCE\n" msgstr "" #. type: SH #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1 #: opensuse-tumbleweed #, no-wrap msgid "DESCRIPTION" msgstr "" #. type: Plain text #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1 #: opensuse-tumbleweed msgid "" "These functions are similar to B(3), except that they write to the " "character string I instead of a stream." msgstr "" #. type: Plain text #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1 #: opensuse-tumbleweed msgid "" "The functions B() and B() write at most I bytes " "(including the terminating null byte (\\[aq]\\[rs]0\\[aq])) to I." msgstr "" #. type: Plain text #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1 #: opensuse-tumbleweed msgid "" "B() is equivalent to B(), except that it is called " "with a I instead of a variable number of arguments. This function " "does not call the I macro. Because it invokes the I macro, " "the value of I is undefined after the call. See B(3)." msgstr "" #. type: Plain text #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1 #: opensuse-tumbleweed msgid "" "C99 and POSIX.1-2001 specify that the results are undefined if a call to " "B() or B() would cause copying to take place between " "objects that overlap (e.g., if the target string array and one of the " "supplied input arguments refer to the same buffer). See CAVEATS." msgstr "" #. type: SS #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1 #: opensuse-tumbleweed #, no-wrap msgid "Format of the format string" msgstr "" #. type: Plain text #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1 #: opensuse-tumbleweed msgid "See B(3)." msgstr "" #. type: SH #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1 #: opensuse-tumbleweed #, no-wrap msgid "RETURN VALUE" msgstr "" #. type: Plain text #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1 #: opensuse-tumbleweed msgid "" "Upon successful return, these functions return the number of bytes printed " "(excluding the null byte used to end output to strings)." msgstr "" #. type: Plain text #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1 #: opensuse-tumbleweed msgid "" "The functions B() and B() do not write more than " "I bytes (including the terminating null byte (\\[aq]\\[rs]0\\[aq])). " "If the output was truncated due to this limit, then the return value is the " "number of characters (excluding the terminating null byte) which would have " "been written to the final string if enough space had been available. Thus, " "a return value of I or more means that the output was truncated. (See " "also below under CAVEATS.)" msgstr "" #. type: Plain text #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1 #: opensuse-tumbleweed msgid "" "On error, a negative value is returned, and I is set to indicate the " "error." msgstr "" #. type: SH #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1 #: opensuse-tumbleweed #, no-wrap msgid "ERRORS" msgstr "" #. type: SH #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1 #: opensuse-tumbleweed #, no-wrap msgid "ATTRIBUTES" msgstr "" #. type: Plain text #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1 #: opensuse-tumbleweed msgid "" "For an explanation of the terms used in this section, see B(7)." msgstr "" #. type: tbl table #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1 #: opensuse-tumbleweed #, no-wrap msgid "Interface" msgstr "" #. type: tbl table #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1 #: opensuse-tumbleweed #, no-wrap msgid "Attribute" msgstr "" #. type: tbl table #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1 #: opensuse-tumbleweed #, no-wrap msgid "Value" msgstr "" #. type: tbl table #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1 #: opensuse-tumbleweed #, no-wrap msgid ".na\n" msgstr "" #. type: tbl table #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1 #: opensuse-tumbleweed #, no-wrap msgid ".nh\n" msgstr "" #. type: tbl table #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1 #: opensuse-tumbleweed #, no-wrap msgid "" "B(),\n" "B()" msgstr "" #. type: tbl table #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1 #: opensuse-tumbleweed #, no-wrap msgid "Thread safety" msgstr "" #. type: tbl table #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1 #: opensuse-tumbleweed #, no-wrap msgid "MT-Safe locale" msgstr "" #. type: SH #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1 #: opensuse-tumbleweed #, no-wrap msgid "STANDARDS" msgstr "" #. type: Plain text #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1 #: opensuse-tumbleweed msgid "C11, POSIX.1-2008." msgstr "" #. type: SH #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1 #: opensuse-tumbleweed #, no-wrap msgid "HISTORY" msgstr "" #. type: Plain text #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1 #: opensuse-tumbleweed msgid "SUSv2, C99, POSIX.1-2001." msgstr "" #. type: Plain text #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1 #: opensuse-tumbleweed msgid "" "Concerning the return value, SUSv2 and C99 contradict each other: when " "B() is called with I=0 then SUSv2 stipulates an unspecified " "return value less than 1, while C99 allows I to be NULL in this case, " "and gives the return value (as always) as the number of characters that " "would have been written in case the output string has been large enough. " "POSIX.1-2001 and later align their specification of B() with C99." msgstr "" #. type: SH #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1 #: opensuse-tumbleweed #, no-wrap msgid "CAVEATS" msgstr "" #. type: Plain text #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1 #: opensuse-tumbleweed msgid "Some programs imprudently rely on code such as the following" msgstr "" #. type: Plain text #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1 #: opensuse-tumbleweed #, no-wrap msgid "snprintf(buf, countof(buf), \"%s some further text\", buf);\n" msgstr "" #. http://sourceware.org/bugzilla/show_bug.cgi?id=7075 #. type: Plain text #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1 #: opensuse-tumbleweed msgid "" "to append text to I. However, the standards explicitly note that the " "results are undefined if source and destination buffers overlap when calling " "B() and B(). Depending on the version of B(1) " "used, and the compiler options employed, calls such as the above will B " "produce the expected results." msgstr "" #. .SH HISTORY #. UNIX V7 defines the three routines #. .BR sprintf (). #. 2.11BSD has #. .BR vsprintf (). #. 4.4BSD introduces the functions #. .BR snprintf () #. and #. .BR vsnprintf (). #. FreeBSD also has functions #. .BR asprintf () #. and #. .BR vasprintf (), #. that allocate a buffer large enough for #. .BR sprintf (). #. type: Plain text #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1 #: opensuse-tumbleweed msgid "" "The glibc implementation of the functions B() and B() " "conforms to the C99 standard, that is, behaves as described above, since " "glibc 2.1. Until glibc 2.0.6, they would return -1 when the output was " "truncated." msgstr "" #. type: SH #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1 #: opensuse-tumbleweed #, no-wrap msgid "BUGS" msgstr "" #. type: SH #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1 #: opensuse-tumbleweed #, no-wrap msgid "EXAMPLES" msgstr "" #. type: Plain text #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1 #: opensuse-tumbleweed msgid "" "To allocate a sufficiently large string and print into it (code correct for " "both glibc 2.0 and glibc 2.1):" msgstr "" #. type: Plain text #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1 #: opensuse-tumbleweed #, no-wrap msgid "" "#include Estdio.hE\n" "#include Estdlib.hE\n" "#include Estdarg.hE\n" "\\&\n" "char *\n" "make_message(const char *fmt, ...)\n" "{\n" " int n = 0;\n" " size_t size = 0;\n" " char *p = NULL;\n" " va_list ap;\n" "\\&\n" " /* Determine required size. */\n" "\\&\n" " va_start(ap, fmt);\n" " n = vsnprintf(p, size, fmt, ap);\n" " va_end(ap);\n" "\\&\n" " if (n E 0)\n" " return NULL;\n" "\\&\n" " size = (size_t) n + 1; /* One extra byte for \\[aq]\\[rs]0\\[aq] */\n" " p = malloc(size);\n" " if (p == NULL)\n" " return NULL;\n" "\\&\n" " va_start(ap, fmt);\n" " n = vsnprintf(p, size, fmt, ap);\n" " va_end(ap);\n" "\\&\n" " if (n E 0) {\n" " free(p);\n" " return NULL;\n" " }\n" "\\&\n" " return p;\n" "}\n" msgstr "" #. type: Plain text #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1 #: opensuse-tumbleweed msgid "" "If truncation occurs in glibc versions prior to glibc 2.0.6, this is treated " "as an error instead of being handled gracefully." msgstr "" #. type: SH #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1 #: opensuse-tumbleweed #, no-wrap msgid "SEE ALSO" msgstr "" #. type: Plain text #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1 #: opensuse-tumbleweed msgid "" "B(1), B(3), B(3), B(3), B(3), " "B(3), B(3), B(3), B(3), B(5)" msgstr "" #. type: TH #: mageia-cauldron #, no-wrap msgid "Linux man-pages 6.17" msgstr "" #. type: TH #: opensuse-leap-16-1 opensuse-tumbleweed #, no-wrap msgid "Linux man-pages (unreleased)" msgstr ""