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.
This commit is contained in:
Michael Natterer 2019-06-03 02:22:20 +02:00
parent 0be9b233dc
commit ae2ef1472c
2 changed files with 2 additions and 2 deletions

View File

@ -1951,7 +1951,7 @@ weed_out_neg_zero (gchar *str,
gchar neg_zero[8]; gchar neg_zero[8];
g_snprintf (neg_zero, 8, "%0.*f", digits, -0.0); g_snprintf (neg_zero, 8, "%0.*f", digits, -0.0);
if (strcmp (neg_zero, str) == 0) if (strcmp (neg_zero, str) == 0)
memmove (str, str + 1, strlen (str) - 1); memmove (str, str + 1, strlen (str));
} }
return str; return str;
} }

View File

@ -1129,7 +1129,7 @@ weed_out_neg_zero (gchar *str,
gchar neg_zero[8]; gchar neg_zero[8];
g_snprintf (neg_zero, 8, "%0.*f", digits, -0.0); g_snprintf (neg_zero, 8, "%0.*f", digits, -0.0);
if (strcmp (neg_zero, str) == 0) if (strcmp (neg_zero, str) == 0)
memmove (str, str + 1, strlen (str) - 1); memmove (str, str + 1, strlen (str));
} }
return str; return str;
} }