mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2025-01-04 09:40:19 +00:00
gtk: fix weed_out_neg_zero() in spinbutton and scale
It was not copying the terminating \0 in the string, breaking output
in spinbutton (didn't try scale). Fixes #3452.
(cherry picked from commit ae2ef1472c
)
This commit is contained in:
parent
7e9cb07a92
commit
caf50bcb93
@ -1544,7 +1544,7 @@ weed_out_neg_zero (gchar *str,
|
||||
gchar neg_zero[8];
|
||||
g_snprintf (neg_zero, 8, "%0.*f", digits, -0.0);
|
||||
if (strcmp (neg_zero, str) == 0)
|
||||
memmove (str, str + 1, strlen (str) - 1);
|
||||
memmove (str, str + 1, strlen (str));
|
||||
}
|
||||
return str;
|
||||
}
|
||||
|
@ -1101,7 +1101,7 @@ weed_out_neg_zero (gchar *str,
|
||||
gchar neg_zero[8];
|
||||
g_snprintf (neg_zero, 8, "%0.*f", digits, -0.0);
|
||||
if (strcmp (neg_zero, str) == 0)
|
||||
memmove (str, str + 1, strlen (str) - 1);
|
||||
memmove (str, str + 1, strlen (str));
|
||||
}
|
||||
return str;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user