Segmentation fault with "./pgm" but not with "wine ./pgm"