title: When does fwprintf return a negative number?
body: <p>I couldn't find it in the docs anywhere, all I did find was that it returns a negative number when an error occurs. What error can it be?</p>
  
  <p>The error occurs in a function that looks like this:</p>
  
  <pre><code>void foo(wchar_t** a)
  {
      for (int i = 0; i &lt; N; i++)
          if (fwprintf(stderr, L"%ls ", a[i]) &lt; 0)
              puts("OOPS!");
      fwprintf(stderr, L"\n");
  }
  </code></pre>
  
  <p>Also, this error appears only at one point during the program execution and stays there, as if some kind of limit was reached.</p>