Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GPSD: Fix double DST correction #229

Merged
merged 2 commits into from
May 17, 2017
Merged

GPSD: Fix double DST correction #229

merged 2 commits into from
May 17, 2017

Conversation

jochym
Copy link
Contributor

@jochym jochym commented May 17, 2017

No description provided.

@jochym
Copy link
Contributor Author

jochym commented May 17, 2017

Should fix problem with incorrect DST offsets (#228)

@rkaczorek
Copy link
Contributor

rkaczorek commented May 17, 2017

I believe that the change proposed is not complete. All the following lines should be removed from the code:

    // get utc_offset
    double offset = local->tm_gmtoff / 3600;

    // adjust offset for DST
    if (local->tm_isdst)
        offset -= 1;

    // convert offset to string
    sprintf(ts,"%0.0f", offset);
    IUSaveText(&TimeT[1], ts);

The offset is calculated and saved in the lines:

snprintf(ts, sizeof(ts), "%4.2f", (local->tm_gmtoff/3600.0));
IUSaveText(&TimeT[1], ts);

@jochym
Copy link
Contributor Author

jochym commented May 17, 2017

Why the save lines? I do not get it.

@rkaczorek
Copy link
Contributor

rkaczorek commented May 17, 2017

The save is in line 189: IUSaveText(&TimeT[1], ts);
Now you're double saving the offset by leaving the code below you have proposed to remove.

@jochym
Copy link
Contributor Author

jochym commented May 17, 2017

You are right. Removed

@knro knro merged commit fb1643e into indilib:master May 17, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants