summaryrefslogtreecommitdiffstats
path: root/gtk/src/values.c
diff options
context:
space:
mode:
Diffstat (limited to 'gtk/src/values.c')
-rw-r--r--gtk/src/values.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/gtk/src/values.c b/gtk/src/values.c
index 4124b0a26..d8dd74330 100644
--- a/gtk/src/values.c
+++ b/gtk/src/values.c
@@ -683,16 +683,23 @@ ghb_array_len(const GValue *gval)
static void
xform_string_int(const GValue *sval, GValue *ival)
{
+ gchar *end;
+
const gchar *str = g_value_get_string(sval);
- gint val = g_strtod(str, NULL);
+ gint val = g_strtod(str, &end);
+ if (*end)
+ val = ~0>>1;
g_value_set_int(ival, val);
}
static void
xform_string_int64(const GValue *sval, GValue *ival)
{
+ gchar *end;
const gchar *str = g_value_get_string(sval);
- gint64 val = g_strtod(str, NULL);
+ gint64 val = g_strtod(str, &end);
+ if (*end)
+ val = ~0L>>1;
g_value_set_int64(ival, val);
}