projects
/
gnulib.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Mention that the 'free' module, LIA-1.
[gnulib.git]
/
lib
/
getloadavg.c
diff --git
a/lib/getloadavg.c
b/lib/getloadavg.c
index
dce4117
..
ed079b2
100644
(file)
--- a/
lib/getloadavg.c
+++ b/
lib/getloadavg.c
@@
-606,7
+606,9
@@
getloadavg (double loadavg[], int nelem)
return -1;
/* The following sscanf must use the C locale. */
return -1;
/* The following sscanf must use the C locale. */
- old_locale = xstrdup (setlocale (LC_NUMERIC, NULL));
+ old_locale = setlocale (LC_NUMERIC, NULL);
+ if (old_locale)
+ old_locale = xstrdup (old_locale);
setlocale (LC_NUMERIC, "C");
count = sscanf (ldavgbuf, "%lf %lf %lf",
&load_ave[0], &load_ave[1], &load_ave[2]);
setlocale (LC_NUMERIC, "C");
count = sscanf (ldavgbuf, "%lf %lf %lf",
&load_ave[0], &load_ave[1], &load_ave[2]);