aboutsummaryrefslogtreecommitdiff
path: root/xorg-server/os/log.c
diff options
context:
space:
mode:
Diffstat (limited to 'xorg-server/os/log.c')
-rw-r--r--xorg-server/os/log.c21
1 files changed, 18 insertions, 3 deletions
diff --git a/xorg-server/os/log.c b/xorg-server/os/log.c
index 23f181d8d..a65b03c66 100644
--- a/xorg-server/os/log.c
+++ b/xorg-server/os/log.c
@@ -304,7 +304,13 @@ pnprintf(char *string, size_t size, const char *f, va_list args)
continue;
}
- switch (f[++f_idx]) {
+ f_idx++;
+
+ /* silently swallow length modifiers */
+ while (f_idx < f_len && ((f[f_idx] >= '0' && f[f_idx] <= '9') || f[f_idx] == '.'))
+ f_idx++;
+
+ switch (f[f_idx]) {
case 's':
string_arg = va_arg(args, char*);
p_len = strlen_sigsafe(string_arg);
@@ -351,7 +357,16 @@ pnprintf(char *string, size_t size, const char *f, va_list args)
for (i = 0; i < p_len && s_idx < size - 1; i++)
string[s_idx++] = number[i];
break;
-
+ case 'f':
+ {
+ double d = va_arg(args, double);
+ FormatDouble(d, number);
+ p_len = strlen_sigsafe(number);
+
+ for (i = 0; i < p_len && s_idx < size - 1; i++)
+ string[s_idx++] = number[i];
+ }
+ break;
default:
va_arg(args, char*);
string[s_idx++] = '%';
@@ -654,7 +669,7 @@ AbortServer(void)
#endif
CloseWellKnownConnections();
OsCleanup(TRUE);
- CloseDownDevices();
+ AbortDevices();
AbortDDX(EXIT_ERR_ABORT);
fflush(stderr);
if (CoreDump)