From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/12906 Path: news.gmane.org!.POSTED!not-for-mail From: Daniel Sabogal Newsgroups: gmane.linux.lib.musl.general Subject: [PATCH] strftime: fix underlying format string in %z format Date: Mon, 11 Jun 2018 13:15:15 -0400 Message-ID: <20180611171515.3920-1-dsabogalcc@gmail.com> Reply-To: musl@lists.openwall.com NNTP-Posting-Host: blaine.gmane.org X-Trace: blaine.gmane.org 1528737117 26231 195.159.176.226 (11 Jun 2018 17:11:57 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Mon, 11 Jun 2018 17:11:57 +0000 (UTC) To: musl@lists.openwall.com Original-X-From: musl-return-12922-gllmg-musl=m.gmane.org@lists.openwall.com Mon Jun 11 19:11:53 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 1fSQMD-0006i2-0S for gllmg-musl@m.gmane.org; Mon, 11 Jun 2018 19:11:53 +0200 Original-Received: (qmail 18370 invoked by uid 550); 11 Jun 2018 17:13:59 -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 18295 invoked from network); 11 Jun 2018 17:13:58 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id; bh=MoYwFVGnvVR8ny2BP0CYbjjEGHxCsRGrCrHK0+OwsME=; b=GjsLaAyKvN/M7cQX3Un0qtvxkuJjnzizwFqpRBLiSQOhx5w3lbEDmbUTYfQnfuNpme vEKkZ6Aw29EPMuSJaleYjyN1ncvJLKgjyM4W63hy1tP1V2uVddkrymPbRSz237zqiJLC WvwpRCPreb2+U1my1fsBwHESF2jpdwk9s49nrZ7miW+ghZWH384AO9cfMlzXUgIBolXj 9tKrF2BebT3Lc58QP4rlhEi7H0Qg20LhxaMvXZiQWmXaYNpuEvg7M4/QEzGlZPTSBnfG tYzLH7CsbfJIma5hJzkXMq0dlW3OKimYsdJmBJB8QVYt43DV/x35N7GGF/3P3942hZwf W7oQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id; bh=MoYwFVGnvVR8ny2BP0CYbjjEGHxCsRGrCrHK0+OwsME=; b=CsaadkyXVxGtwpFsNB9Obes2WRRE3a4romeVUJGeK8DDgXo8PSP/Ww4fq0sLfs3M+b ymG7OeVBO3CKecTfngg2dBw8DI27bCqA4GChdroBRmv0sIxB+qaw6LLB3fGdiibACw+q NaL6XftGN+mDT3j7xRyuILiYARkb+6PNiJOdCZGZszwRv5Tk+8ODOh2vGthOplWQ4XLT kBb6dXo4GzW4mhNH2DydnJdioDWOUcYAzsknjzO+KjOvzLGSl1EonnpVOPUE4EEjQYh1 rVm/eVh0xpzl9iyE5MApdcDSQT+4v4eDtJyjb6g6LbnOsyTXaxChJwrxcKIQMdlMLfgG opNg== X-Gm-Message-State: APt69E1pQPomWOuw6BUYHdBPK/mU5RlhHkvMgMk6+WQC04OmsfEq3e5s EszNPk5dBAye7dslzSJseeq3Uw== X-Google-Smtp-Source: ADUXVKIc1pOYfUTo3cAs9qHmsYhQN/3FVX1307NJNyXdoNUpB9SaNupMofeb1fNaRZX/oqgm5yJdJw== X-Received: by 2002:ab0:43a4:: with SMTP id l33-v6mr4544ual.179.1528737226464; Mon, 11 Jun 2018 10:13:46 -0700 (PDT) X-Mailer: git-send-email 2.17.1 Xref: news.gmane.org gmane.linux.lib.musl.general:12906 Archived-At: 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