]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
Prefer c_strtod to setlocale when scanning floating point.
authorPaul Eggert <eggert@cs.ucla.edu>
Tue, 13 Jul 2004 00:07:26 +0000 (00:07 +0000)
committerPaul Eggert <eggert@cs.ucla.edu>
Tue, 13 Jul 2004 00:07:26 +0000 (00:07 +0000)
ChangeLog
lib/ChangeLog
m4/ChangeLog

index 61dd15e110958c4d2bea400df1772cea0d1c5b47..39eec6a8f50ec7b11deb583a61ed0e5e07957716 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2004-07-12  Paul Eggert  <eggert@cs.ucla.edu>
+
+       * src/uptime.c: Include c-strtod.h.
+       (print_uptime): Use c_strtod instead of setlocale and sscanf.
+       Use long int rather than int to count days (for 64-bit hosts),
+       and check for arithmetic overflow when converting double to time_t.
+
 2004-07-11  Paul Eggert  <eggert@cs.ucla.edu>
 
        * src/printf.c (vstrtold): Renamed from vstrtod.
index 5505bbac9fde2ac0c736d25cc2f9eabecfd7b5c7..68138d128bcfa63758b508cf2a6086837b228aa6 100644 (file)
@@ -1,3 +1,21 @@
+2004-07-12  Paul Eggert  <eggert@cs.ucla.edu>
+
+       * c-strtod.c (STRTOD_L): New macro.
+       (C_STRTOD) [defined LC_ALL_MASK]: Use it, so that the
+       code is reentrant on platforms that have strtod_l.
+
+       * getloadavg.c: Include <errno.h>, <stdio.h>, <stdlib.h> even
+       if HAVE_GETLOADAVG is defined, so that the test program can work.
+       (errno): Remove declaration; not needed in C89 or later.
+       Include "c-strtod.h".
+       Do not include locale.h or define setlocale; no longer needed.
+       Include <limits.h>.
+       (INT_STRLEN_BOUND): New macro.
+       (getloadavg): Use it to compute buffer size.
+       Don't assume that buffer will be properly terminated by 'read'.
+       Use c_strtod instead of setlocale.
+       (main) [defined TEST]: Return int, not void.
+       
 2004-07-11  Paul Eggert  <eggert@cs.ucla.edu>
 
        * Makefile.am (libfetish_a_SOURCES): Add c-strtold.c.
index 5c96960ae51d816427d4574486b4b9a9a7d9996d..96f0a13613a2567f490b3f748dcae70243b7939c 100644 (file)
@@ -1,3 +1,7 @@
+2004-07-12  Paul Eggert  <eggert@cs.ucla.edu>
+
+       * c-strtod.m4 (gl_C_STRTOD): Add gl_USE_SYSTEM_EXTENSIONS.
+
 2004-07-11  Paul Eggert  <eggert@cs.ucla.edu>
 
        * c-strtod.m4: New file.