mirror of https://github.com/GNOME/gimp.git
R5RS fix adds decimal point for inexact in atom2str (SourceForge bug #3395548)
This commit is contained in:
parent
6af99d4793
commit
7ab6704f78
|
@ -2127,6 +2127,13 @@ static void atom2str(scheme *sc, pointer l, int f, char **pp, int *plen) {
|
|||
snprintf(p, STRBUFFSIZE, "%ld", ivalue_unchecked(l));
|
||||
} else {
|
||||
snprintf(p, STRBUFFSIZE, "%.10g", rvalue_unchecked(l));
|
||||
/* R5RS says there must be a '.' (unless 'e'?) */
|
||||
f = strcspn(p, ".e");
|
||||
if (p[f] == 0) {
|
||||
p[f] = '.'; // not found, so add '.0' at the end
|
||||
p[f+1] = '0';
|
||||
p[f+2] = 0;
|
||||
}
|
||||
}
|
||||
} else if (is_string(l)) {
|
||||
if (!f) {
|
||||
|
|
Loading…
Reference in New Issue