1 #define _GNU_SOURCE 1 2 #include <wchar.h> 3 #include <stdio.h> 4 #include <string.h> 5 #include <wctype.h> 6 7 8 int main(void)9main(void) 10 { 11 int result = 0; 12 char buf[100]; 13 wchar_t tmp[3]; 14 tmp[0] = '8'; 15 tmp[1] = '1'; 16 tmp[2] = 0; 17 18 snprintf(buf, 100, "%S = %f", tmp, wcstof(tmp, NULL)); 19 printf("\"%s\" -> %s\n", buf, strcmp(buf, "81 = 81.000000") == 0 ? "okay" 20 : "buggy"); 21 result |= strcmp(buf, "81 = 81.000000") != 0; 22 23 return result; 24 } 25