Nasty bug in dtostrf

I’ve found a strange issue that seems like a nasty bug in dtostrf. I’ve noticed it when converting gps longitudes into strings. I don’t have an arduino zero to check on it.
Find bellow the code that reproduces the error, in my Autonomo (with the latests updates in all libraries) I get from the serial monitor:

long=-5.575418
String from dtostrf: -5.424

so the double is converted to the wrong string.

Here is the test code:

#include <avr/dtostrf.h>
char strLng[12];
float gpslong=-5.575418;
void setup() {
  SerialUSB.begin(115200);
}

void loop() {
  dtostrf (gpslong, 11,6, strLng); 
  SerialUSB.print("long=");
  SerialUSB.println(gpslong,6);
  SerialUSB.print("String from dtostrf: ");
  SerialUSB.println(strLng);
  delay(1000);

}

Thanks

With the test version of the upcoming v1.6.7 SODAQ Boards Manager it is solved.
See my other post on the forum about Boards Manager for LoRaONE beta

The result of your code, for me, is:

long=-5.575418
String from dtostrf:   -5.575418

BTW. To add C code in your post you have to add 4 spaces at the start of each line.

Thanks a lot. Solved.