public inbox for libc-hacker@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] For bogus TZ values use offset 0 rather than 1 or -1
@ 2004-12-06 22:45 Jakub Jelinek
  2004-12-06 22:51 ` Ulrich Drepper
  0 siblings, 1 reply; 2+ messages in thread
From: Jakub Jelinek @ 2004-12-06 22:45 UTC (permalink / raw)
  To: Ulrich Drepper; +Cc: Glibc hackers

Hi!

For say TZ=FOOT+X or TZ=BAR-
tzset doesn't use UTC, but offset -1L resp. 1L.  While user's
shouldn't expect anything particular in that case, I think it
is better to clear offset if the sscanf after first + or -
fails.

2004-12-06  Jakub Jelinek  <jakub@redhat.com>

	* time/tzset.c (tzset_internal): If + or - is seen,
	but no offset after it, reset offset to 0.  [BZ #601]

--- libc/time/tzset.c.jj	2004-09-16 11:35:42.000000000 +0200
+++ libc/time/tzset.c	2004-12-06 23:07:17.034717956 +0100
@@ -240,6 +240,7 @@ tzset_internal (always, explicit)
   switch (sscanf (tz, "%hu:%hu:%hu", &hh, &mm, &ss))
     {
     default:
+      tz_rules[0].offset = 0;
       goto out;
     case 1:
       mm = 0;

	Jakub

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

* Re: [PATCH] For bogus TZ values use offset 0 rather than 1 or -1
  2004-12-06 22:45 [PATCH] For bogus TZ values use offset 0 rather than 1 or -1 Jakub Jelinek
@ 2004-12-06 22:51 ` Ulrich Drepper
  0 siblings, 0 replies; 2+ messages in thread
From: Ulrich Drepper @ 2004-12-06 22:51 UTC (permalink / raw)
  To: Jakub Jelinek; +Cc: Glibc hackers

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Applied.

- --
➧ Ulrich Drepper ➧ Red Hat, Inc. ➧ 444 Castro St ➧ Mountain View, CA ❖
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.6 (GNU/Linux)

iD8DBQFBtOJD2ijCOnn/RHQRAvdkAKCBu+6XNC5fjaLsxlMy3J6FZMaG2ACgpuDn
sHQ+OTvuMe6S/RxisYuNnQ4=
=4Z4r
-----END PGP SIGNATURE-----

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

end of thread, other threads:[~2004-12-06 22:51 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-12-06 22:45 [PATCH] For bogus TZ values use offset 0 rather than 1 or -1 Jakub Jelinek
2004-12-06 22:51 ` Ulrich Drepper

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).