Skip to content
Snippets Groups Projects
Commit 5f593b88 authored by Rob Swindell's avatar Rob Swindell :speech_balloon:
Browse files

Fix small negative UTC-offset output from smb_zonestr()

When passed values between (-1 and -59), this function would output something
nonsensical like: "UTC0:01" or "UTC0:59". Now we'll make sure there's a minus
sign in these conditions (e.g. "UTC-0:01" and "UTC-0:59").
parent cb710acf
No related branches found
No related tags found
1 merge request!488Overhaul LZH code
...@@ -241,6 +241,8 @@ char* smb_zonestr(int16_t zone, char* str) ...@@ -241,6 +241,8 @@ char* smb_zonestr(int16_t zone, char* str)
if(zone>0) if(zone>0)
plus="+"; plus="+";
else if((zone / 60) == 0)
plus="-";
else else
plus=""; plus="";
sprintf(str,"UTC%s%d:%02u", plus, zone/60, zone<0 ? (-zone)%60 : zone%60); sprintf(str,"UTC%s%d:%02u", plus, zone/60, zone<0 ? (-zone)%60 : zone%60);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment