Fixed behaviour when locale is not C s/strtod/g_ascii_strod/. (strtod
* loadavg.c: (glibtop_get_loadavg_s): * uptime.c: (glibtop_get_uptime_s): Fixed behaviour when locale is not C s/strtod/g_ascii_strod/. (strtod behaviour is locale specific, which is bad because linux /proc is always C.
This commit is contained in:
@@ -55,8 +55,8 @@ glibtop_get_uptime_s (glibtop *server, glibtop_uptime *buf)
|
||||
|
||||
file_to_buffer(server, buffer, FILENAME);
|
||||
|
||||
buf->uptime = strtod (buffer, &p);
|
||||
buf->idletime = strtod (p, &p);
|
||||
buf->uptime = g_ascii_strtod (buffer, &p);
|
||||
buf->idletime = g_ascii_strtod (p, &p);
|
||||
buf->boot_time = (guint64) time(NULL) - (guint64) buf->uptime;
|
||||
|
||||
buf->flags = _glibtop_sysdeps_uptime;
|
||||
|
Reference in New Issue
Block a user