4
0
mirror of git://sourceware.org/git/newlib-cygwin.git synced 2025-01-19 21:09:22 +08:00
Corinna Vinschen 09981903e6 Cygwin: ps: fix compiler warning in ttynam
The helper function ttynam creates a tty name by using sprintf wrongly
on a pretty short buffer.  The foramt string only specifies a minimum
field length, not a maximum field length, so gcc-9.2.0 complains:

  ps.cc:101:23: warning: 'sprintf' may write a terminating nul past the
  end of the destination [-Wformat-overflow=]

Fix this thoroughly by specifying a maximum field width as well as by
using snprintf with a fixed buffer length.  Also, drop using a static
buffer in favor of using a buffer in the caller.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2020-02-26 21:08:51 +01:00
..
2013-11-07 00:19:52 +00:00
2012-11-23 13:22:47 +00:00
2018-12-26 09:24:33 +01:00
2019-06-04 11:31:54 -04:00
2018-01-19 13:19:21 -06:00
2016-08-17 10:58:04 +02:00
2018-12-26 09:24:33 +01:00
2016-10-23 17:16:30 +02:00