fortify-headers

standalone fortify-source implementation
git clone git://git.2f30.org/fortify-headers
Log | Files | Refs | README | LICENSE

test_mbsrtowcs_static.c (255B)


      1 #include "common.h"
      2 
      3 #define _GNU_SOURCE
      4 #include <wchar.h>
      5 
      6 int main(int argc, char** argv) {
      7   wchar_t dest[3];
      8   const char* src = "abcdefghijklmnopq";
      9   mbstate_t ps;
     10 
     11   CHK_FAIL_START
     12   mbsrtowcs(dest, &src, 12, &ps);
     13   CHK_FAIL_END
     14 
     15   return ret;
     16 }