fortify-headers

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

test_mbstowcs_static.c (272B)


      1 #include "common.h"
      2 
      3 #include <stdlib.h>
      4 
      5 int main(int argc, char** argv) {
      6   const char* mbstr = "z\u00df\u6c34\U0001f34c"; // or u8"zß水🍌"
      7   wchar_t wstr[5];
      8   mbstowcs(wstr, mbstr, 4);
      9 
     10   CHK_FAIL_START
     11   mbstowcs(wstr, mbstr, 16);
     12   CHK_FAIL_END
     13 
     14   return ret;
     15 }