Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
[PATCH 0/1] Fix -Wformat-overflow= warnings in zftp.c
- X-seq: zsh-workers 44162
- From: Wesley Schwengle <wesleyschwengle@xxxxxxxxx>
- To: zsh-workers@xxxxxxx
- Subject: [PATCH 0/1] Fix -Wformat-overflow= warnings in zftp.c
- Date: Sat, 23 Mar 2019 11:11:34 +0100
- Cc: Wesley Schwengle <wesley@xxxxxxxxxx>
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=jh4kzLmXrmmMN4pIykecxj2O/dbaIcJDb9X/w5azUQU=; b=K5UOTaCuYPFs7RGNHhg+SwzOwTXuYqM2vEqtUrJawASL5ztiFfmbj41nSBUY74ZjgO 0lVWlGxW29nfHRkSSNrYKBTs/CsCEW8l1kjP7vUEgj+/0tAFsaYgap34jiLosDVwGT1i ASjN2MPJlj0Xukp5KN7Ckj78cWo7g47iPqinBpt1J991UdCDn6esfmJe77bXQi5TJYZY 4Kww1K+Bg7l4ZndQV5oRxlCURVpxb2iFUrjeMIvh/HM08koWJGz9lVY/M+44yleRGox6 TwBk9zA+17kLFodt8Z9VR8NwZnDty+0vqTDQiy7og8NJrDpGdJeWtFFnAFyHPUgqY1Ud hHqA==
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- List-unsubscribe: <mailto:zsh-workers-unsubscribe@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
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
Messages sorted by:
Reverse Date,
Date,
Thread,
Author