# AUTHOR <EMAIL@ADDRESS>, YEAR.
# 
# Translators:
msgid ""
msgstr ""
"Project-Id-Version: Defensive Coding Guide\n"
"POT-Creation-Date: 2013-03-12T03:19:44\n"
"PO-Revision-Date: 2013-03-19 15:30+0000\n"
"Last-Translator: Automatically generated\n"
"Language-Team: Italian <trans-it@lists.fedoraproject.org>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Language: it\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"

#. Tag: programlisting
#, no-c-format
msgid ""
"\n"
"ssize_t\n"
"extract_strings(const char *in, size_t inlen, char **out, size_t outlen)\n"
"{\n"
"  const char *inp = in;\n"
"  const char *inend = in + inlen;\n"
"  char **outp = out;\n"
"  char **outend = out + outlen;\n"
"\n"
"  while (inp != inend) {\n"
"    size_t len;\n"
"    char *s;\n"
"    if (outp == outend) {\n"
"      errno = ENOSPC;\n"
"      goto err;\n"
"    }\n"
"    len = (unsigned char)*inp;\n"
"    ++inp;\n"
"    if (len &gt; (size_t)(inend - inp)) {\n"
"      errno = EINVAL;\n"
"      goto err;\n"
"    }\n"
"    s = malloc(len + 1);\n"
"    if (s == NULL) {\n"
"      goto err;\n"
"    }\n"
"    memcpy(s, inp, len);\n"
"    inp += len;\n"
"    s[len] = '\\0';\n"
"    *outp = s;\n"
"    ++outp;\n"
"  }\n"
"  return outp - out;\n"
"err:\n"
"  {\n"
"    int errno_old = errno;\n"
"    while (out != outp) {\n"
"      free(*out);\n"
"      ++out;\n"
"    }\n"
"    errno = errno_old;\n"
"  }\n"
"  return -1;\n"
"}\n"
msgstr ""
