Need to detect when the processing endptr hasn't changed in analysing the text input,
otherwise the while loop will get stuck in an infinite loop.
gdouble value;
ptr = strpbrk (endptr, "0123456789,.");
if (ptr != NULL) {
- value = g_strtod((const gchar *)ptr, (gchar **)&endptr);
- nbFloat++;
+ gchar *tmpptr = endptr;
+ value = g_strtod((const gchar *)ptr, (gchar **)&endptr);
+ // Detect when endptr hasn't changed (which may occur if no conversion took place)
+ // particularly if the last character is a ',' or there are multiple '.'s like '5.5.'
+ if ( endptr == tmpptr )
+ break;
+ nbFloat++;
switch(nbFloat) {
case 1:
d = value;