Package: mingw-w64-i686-dev
Version: 7.0.0-2
Severity: normal

Consider the following program:

#include <stdio.h>

int main (void)
{
  char buf[8] = { 0 };
  int r;

  r = snprintf (buf, 3, "abcdef");
  printf ("r = %d, buf = \"%s\"\n", r, buf);

  return 0;
}

When compiling with i686-w64-mingw32-gcc and running under Wine,
I get:

r = -1, buf = "abc"

which is incorrect. Adding the -posix option when compiling solves
the issue, i.e. I get

r = 6, buf = "ab"

but the snprintf function is not specific to POSIX.

-- System Information:
Debian Release: bullseye/sid
  APT prefers unstable-debug
  APT policy: (500, 'unstable-debug'), (500, 'stable-updates'), (500, 
'unstable'), (500, 'testing'), (500, 'stable'), (1, 'experimental')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 5.4.0-2-amd64 (SMP w/12 CPU cores)
Kernel taint flags: TAINT_PROPRIETARY_MODULE, TAINT_OOT_MODULE, 
TAINT_UNSIGNED_MODULE
Locale: LANG=POSIX, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8), LANGUAGE=POSIX 
(charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled

Versions of packages mingw-w64-i686-dev depends on:
ii  mingw-w64-common  7.0.0-2

mingw-w64-i686-dev recommends no packages.

Versions of packages mingw-w64-i686-dev suggests:
ii  wine [wine]  5.0~rc1-2

-- no debconf information

-- 
Vincent Lefèvre <vinc...@vinc17.net> - Web: <https://www.vinc17.net/>
100% accessible validated (X)HTML - Blog: <https://www.vinc17.net/blog/>
Work: CR INRIA - computer arithmetic / AriC project (LIP, ENS-Lyon)

Reply via email to