mirror of
https://gitlab.gnome.org/GNOME/libxml2.git
synced 2025-03-20 18:50:08 +03:00
Remove occasional leading space in XPath number formatting
https://bugzilla.gnome.org/show_bug.cgi?id=704528 Somehow snprintf "%*.*e" can generate a leading space, remove it
This commit is contained in:
parent
81b961788a
commit
b9e4d5b639
6
xpath.c
6
xpath.c
@ -2885,6 +2885,12 @@ xmlXPathFormatNumber(double number, char buffer[], int buffersize)
|
||||
fraction_place, number);
|
||||
}
|
||||
|
||||
/* Remove leading spaces sometimes inserted by snprintf */
|
||||
while (work[0] == ' ') {
|
||||
for (ptr = &work[0];(ptr[0] = ptr[1]);ptr++);
|
||||
size--;
|
||||
}
|
||||
|
||||
/* Remove fractional trailing zeroes */
|
||||
after_fraction = work + size;
|
||||
ptr = after_fraction;
|
||||
|
Loading…
x
Reference in New Issue
Block a user