zsh-workers
 help / color / mirror / code / Atom feed
From: Wesley Schwengle <wesleyschwengle@gmail.com>
To: zsh-workers@zsh.org
Cc: Wesley Schwengle <wesley@mintlab.nl>
Subject: [PATCH 0/1] Fix -Wformat-overflow= warnings in zftp.c
Date: Sat, 23 Mar 2019 11:11:34 +0100	[thread overview]
Message-ID: <20190323101135.14344-1-wesley@mintlab.nl> (raw)

Hello all,

I was compiling zsh from master on my Debian testing box with cc 8.3.0
and I got the following warning:

zftp.c: In function ‘zfstats’:
zftp.c:1265:26: warning: ‘%02d’ directive writing between 2 and 11 bytes
into a region of size between 9 and 16 [-Wformat-overflow=]
sprintf(tmbuf, "%04d%02d%02d%02d%02d%02d",
^~~~
zftp.c:1265:21: note: directive argument in the range [-2147483647, 2147483647]
sprintf(tmbuf, "%04d%02d%02d%02d%02d%02d",
^~~~~~~~~~~~~~~~~~~~~~~~~~
zftp.c:1265:6: note: ‘sprintf’ output between 15 and 67 bytes into a
destination of size 20
sprintf(tmbuf, "%04d%02d%02d%02d%02d%02d",
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
tm->tm_year + 1900, tm->tm_mon+1, tm->tm_mday,
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
tm->tm_hour, tm->tm_min, tm->tm_sec);
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

I made a small patch that resolves the warning.

Cheers,
Wesley

Wesley Schwengle (1):
  Change handrolled strftime to strftime in zftp.c

 Src/Modules/zftp.c | 9 +--------
 1 file changed, 1 insertion(+), 8 deletions(-)

-- 
2.21.0.196.g041f5ea1cf


             reply	other threads:[~2019-03-23 10:12 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-23 10:11 Wesley Schwengle [this message]
2019-03-23 10:11 ` [PATCH] Change handrolled strftime to strftime " Wesley Schwengle
2019-03-25 12:13   ` Jun T
2019-03-25 12:42     ` Peter Stephenson
2019-03-25 13:07       ` Jun T.
2019-03-25 13:32         ` Jun T.
2019-03-25 14:36         ` Peter Stephenson
2019-03-25 15:06           ` Jun T.
2019-03-25 15:08           ` Peter Stephenson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190323101135.14344-1-wesley@mintlab.nl \
    --to=wesleyschwengle@gmail.com \
    --cc=wesley@mintlab.nl \
    --cc=zsh-workers@zsh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).