mirror of
https://github.com/f4exb/sdrangel.git
synced 2024-11-21 23:55:13 -05:00
Fix #1062 - Always use C locale for parsing coords in airport database
This commit is contained in:
parent
bb99edddc1
commit
259e0ad6da
@ -24,6 +24,7 @@
|
||||
#include <QHash>
|
||||
#include <QList>
|
||||
#include <QDebug>
|
||||
#include <QLocale>
|
||||
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
@ -84,6 +85,7 @@ struct AirportInformation {
|
||||
|
||||
FILE *file;
|
||||
QByteArray utfFilename = filename.toUtf8();
|
||||
QLocale cLocale(QLocale::C);
|
||||
if ((file = fopen(utfFilename.constData(), "r")) != NULL)
|
||||
{
|
||||
char row[2048];
|
||||
@ -170,21 +172,21 @@ struct AirportInformation {
|
||||
latitudeString = p;
|
||||
latitudeLen = strlen(latitudeString)-1;
|
||||
latitudeString[latitudeLen] = '\0';
|
||||
latitude = atof(latitudeString);
|
||||
latitude = cLocale.toFloat(latitudeString);
|
||||
}
|
||||
else if (idx == longitudeCol)
|
||||
{
|
||||
longitudeString = p;
|
||||
longitudeLen = strlen(longitudeString)-1;
|
||||
longitudeString[longitudeLen] = '\0';
|
||||
longitude = atof(longitudeString);
|
||||
longitude = cLocale.toFloat(longitudeString);
|
||||
}
|
||||
else if (idx == elevationCol)
|
||||
{
|
||||
elevationString = p;
|
||||
elevationLen = strlen(elevationString)-1;
|
||||
elevationString[elevationLen] = '\0';
|
||||
elevation = atof(elevationString);
|
||||
elevation = cLocale.toFloat(elevationString);
|
||||
}
|
||||
p = strtok(NULL, ",");
|
||||
idx++;
|
||||
|
Loading…
Reference in New Issue
Block a user