public inbox for glibc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug libc/17189] New: Incorrect result for %s in strftime
@ 2014-07-21 16:10 quae at daurnimator dot com
  2014-08-18 19:24 ` [Bug libc/17189] " quae at daurnimator dot com
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: quae at daurnimator dot com @ 2014-07-21 16:10 UTC (permalink / raw)
  To: glibc-bugs

https://sourceware.org/bugzilla/show_bug.cgi?id=17189

            Bug ID: 17189
           Summary: Incorrect result for %s in strftime
           Product: glibc
           Version: unspecified
            Status: NEW
          Severity: normal
          Priority: P2
         Component: libc
          Assignee: unassigned at sourceware dot org
          Reporter: quae at daurnimator dot com
                CC: drepper.fsp at gmail dot com

The %s specifier in strftime doesn't respect timezones.

Example:

    #include <time.h>
    #include <stdio.h>

    int main() {
        time_t t = 1234567890;
        struct tm *tmp = gmtime(&t);
        char output[200];
        strftime(output, 200, "%s", tmp);
        printf("%s\n",output);
        return 0;
    }

Run with a non UTC timezone. e.g. TZ=GMT+9
Output will be 1234600290 instead of expected 1234567890


Location in glibc:
http://fossies.org/dox/glibc-2.19/strftime__l_8c_source.html#l01133

This bug also exists in BSD's libc:
https://svnweb.freebsd.org/base/release/10.0.0/lib/libc/stdtime/strftime.c?view=markup#l312

It does not occur in musl:
http://git.musl-libc.org/cgit/musl/tree/src/time/strftime.c?id=ac0acd569e01735fc6052d43fdf57f3a07c93f3d#n127

-- 
You are receiving this mail because:
You are on the CC list for the bug.


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Bug libc/17189] Incorrect result for %s in strftime
  2014-07-21 16:10 [Bug libc/17189] New: Incorrect result for %s in strftime quae at daurnimator dot com
@ 2014-08-18 19:24 ` quae at daurnimator dot com
  2015-01-03  1:39 ` emaste at freebsd dot org
  2015-08-27 22:23 ` [Bug time/17189] " jsm28 at gcc dot gnu.org
  2 siblings, 0 replies; 4+ messages in thread
From: quae at daurnimator dot com @ 2014-08-18 19:24 UTC (permalink / raw)
  To: glibc-bugs

https://sourceware.org/bugzilla/show_bug.cgi?id=17189

daurnimator <quae at daurnimator dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |quae at daurnimator dot com

-- 
You are receiving this mail because:
You are on the CC list for the bug.


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Bug libc/17189] Incorrect result for %s in strftime
  2014-07-21 16:10 [Bug libc/17189] New: Incorrect result for %s in strftime quae at daurnimator dot com
  2014-08-18 19:24 ` [Bug libc/17189] " quae at daurnimator dot com
@ 2015-01-03  1:39 ` emaste at freebsd dot org
  2015-08-27 22:23 ` [Bug time/17189] " jsm28 at gcc dot gnu.org
  2 siblings, 0 replies; 4+ messages in thread
From: emaste at freebsd dot org @ 2015-01-03  1:39 UTC (permalink / raw)
  To: glibc-bugs

https://sourceware.org/bugzilla/show_bug.cgi?id=17189

emaste at freebsd dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |emaste at freebsd dot org

-- 
You are receiving this mail because:
You are on the CC list for the bug.


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Bug time/17189] Incorrect result for %s in strftime
  2014-07-21 16:10 [Bug libc/17189] New: Incorrect result for %s in strftime quae at daurnimator dot com
  2014-08-18 19:24 ` [Bug libc/17189] " quae at daurnimator dot com
  2015-01-03  1:39 ` emaste at freebsd dot org
@ 2015-08-27 22:23 ` jsm28 at gcc dot gnu.org
  2 siblings, 0 replies; 4+ messages in thread
From: jsm28 at gcc dot gnu.org @ 2015-08-27 22:23 UTC (permalink / raw)
  To: glibc-bugs

https://sourceware.org/bugzilla/show_bug.cgi?id=17189

Joseph Myers <jsm28 at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
          Component|libc                        |time

-- 
You are receiving this mail because:
You are on the CC list for the bug.


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2015-08-27 22:23 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-07-21 16:10 [Bug libc/17189] New: Incorrect result for %s in strftime quae at daurnimator dot com
2014-08-18 19:24 ` [Bug libc/17189] " quae at daurnimator dot com
2015-01-03  1:39 ` emaste at freebsd dot org
2015-08-27 22:23 ` [Bug time/17189] " jsm28 at gcc dot gnu.org

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 read-only IMAP folder(s) and NNTP newsgroup(s).