From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/12946 Path: news.gmane.org!.POSTED!not-for-mail From: Rich Felker Newsgroups: gmane.linux.lib.musl.general Subject: Re: [PATCH] strftime: fix underlying format string in %z format Date: Tue, 26 Jun 2018 16:45:50 -0400 Message-ID: <20180626204550.GZ1392@brightrain.aerifal.cx> References: <20180611171515.3920-1-dsabogalcc@gmail.com> Reply-To: musl@lists.openwall.com NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: blaine.gmane.org 1530045840 5028 195.159.176.226 (26 Jun 2018 20:44:00 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Tue, 26 Jun 2018 20:44:00 +0000 (UTC) User-Agent: Mutt/1.5.21 (2010-09-15) To: musl@lists.openwall.com Original-X-From: musl-return-12962-gllmg-musl=m.gmane.org@lists.openwall.com Tue Jun 26 22:43:55 2018 Return-path: Envelope-to: gllmg-musl@m.gmane.org Original-Received: from mother.openwall.net ([195.42.179.200]) by blaine.gmane.org with smtp (Exim 4.84_2) (envelope-from ) id 1fXuod-0001Cd-J1 for gllmg-musl@m.gmane.org; Tue, 26 Jun 2018 22:43:55 +0200 Original-Received: (qmail 24014 invoked by uid 550); 26 Jun 2018 20:46:04 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-ID: Original-Received: (qmail 23996 invoked from network); 26 Jun 2018 20:46:03 -0000 Content-Disposition: inline In-Reply-To: <20180611171515.3920-1-dsabogalcc@gmail.com> Original-Sender: Rich Felker Xref: news.gmane.org gmane.linux.lib.musl.general:12946 Archived-At: On Mon, Jun 11, 2018 at 01:15:15PM -0400, Daniel Sabogal wrote: > the expression (tm->__tm_gmtoff)/3600 has type long. use %+.2ld instead. > --- > src/time/strftime.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/src/time/strftime.c b/src/time/strftime.c > index 708875ee..0a256970 100644 > --- a/src/time/strftime.c > +++ b/src/time/strftime.c > @@ -181,7 +181,7 @@ const char *__strftime_fmt_1(char (*s)[100], size_t *l, int f, const struct tm * > *l = 0; > return ""; > } > - *l = snprintf(*s, sizeof *s, "%+.2d%.2d", > + *l = snprintf(*s, sizeof *s, "%+.2ld%.2d", > (tm->__tm_gmtoff)/3600, > abs(tm->__tm_gmtoff%3600)/60); > return *s; > -- > 2.17.1 Thanks. Applied. Rich