diff options
author | Matthias Clasen <mclasen@redhat.com> | 2015-12-22 21:58:31 -0500 |
---|---|---|
committer | Matthias Clasen <mclasen@redhat.com> | 2015-12-22 22:29:22 -0500 |
commit | d92111256f818b1d2af95916a3cfe4bde16865ba (patch) | |
tree | 0e01b08e12909bd24c39d07605fa53026c711060 /gtk/gtkcssnumbervalue.c | |
parent | 6b497bcf8135541f4ec61e6e72708839dbd3c251 (diff) | |
download | gtk+-d92111256f818b1d2af95916a3cfe4bde16865ba.tar.gz |
fix printing of numbers
We should be printing infinite, not inf.
Diffstat (limited to 'gtk/gtkcssnumbervalue.c')
-rw-r--r-- | gtk/gtkcssnumbervalue.c | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/gtk/gtkcssnumbervalue.c b/gtk/gtkcssnumbervalue.c index 927e9bfce9..5db0758535 100644 --- a/gtk/gtkcssnumbervalue.c +++ b/gtk/gtkcssnumbervalue.c @@ -17,6 +17,8 @@ #include "config.h" +#include <math.h> + #include "gtkcssnumbervalueprivate.h" #include "gtkcssenumvalueprivate.h" @@ -201,10 +203,15 @@ gtk_css_value_number_print (const GtkCssValue *number, /* [GTK_CSS_MS] = */ "ms", }; - g_ascii_dtostr (buf, sizeof (buf), number->value); - g_string_append (string, buf); - if (number->value != 0.0) - g_string_append (string, names[number->unit]); + if (isinf (number->value)) + g_string_append (string, "infinite"); + else + { + g_ascii_dtostr (buf, sizeof (buf), number->value); + g_string_append (string, buf); + if (number->value != 0.0) + g_string_append (string, names[number->unit]); + } } static const GtkCssValueClass GTK_CSS_VALUE_NUMBER = { |