Skip to content

Commit

Permalink
Fix -00 case as suggested by Kristopher.
Browse files Browse the repository at this point in the history
  • Loading branch information
knro authored and karlrees committed Mar 24, 2021
1 parent 28b27ff commit a09e67a
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions drivers/auxiliary/skysafari.cpp
Expand Up @@ -33,7 +33,7 @@

#include <cerrno>
#include <cstring>

#include <cmath>
#include <fcntl.h>
#include <unistd.h>
#include <arpa/inet.h>
Expand Down Expand Up @@ -127,7 +127,8 @@ bool SkySafari::initProperties()

IUFillSwitch(&ServerControlS[SERVER_ENABLE], "SERVER_ENABLE", "Enabled", ISS_OFF);
IUFillSwitch(&ServerControlS[SERVER_DISABLE], "SERVER_DISABLE", "Disabled", ISS_ON);
IUFillSwitchVector(&ServerControlSP, ServerControlS, 2, getDeviceName(), "SKYSAFARI_SERVER", "Server", MAIN_CONTROL_TAB, IP_RW,
IUFillSwitchVector(&ServerControlSP, ServerControlS, 2, getDeviceName(), "SKYSAFARI_SERVER", "Server", MAIN_CONTROL_TAB,
IP_RW,
ISR_1OFMANY, 0, IPS_IDLE);

IUFillText(&ActiveDeviceT[ACTIVE_TELESCOPE], "ACTIVE_TELESCOPE", "Telescope", "Telescope Simulator");
Expand Down Expand Up @@ -531,7 +532,7 @@ void SkySafari::processCommand(std::string cmd)
if (sscanf(cmd.c_str(), "Sd%d*%d:%d", &dd, &mm, &ss) == 3)
{
DE = abs(dd) + mm / 60.0 + ss / 3600.0;
if (dd < 0)
if (std::signbit(dd))
DE *= -1;
}

Expand Down

0 comments on commit a09e67a

Please sign in to comment.