aboutsummaryrefslogtreecommitdiffstats
path: root/gps-track
diff options
context:
space:
mode:
authorGravatar Christian Hesse <mail@eworm.de>2019-01-29 09:32:18 +0100
committerGravatar Christian Hesse <mail@eworm.de>2019-01-29 09:32:18 +0100
commitb3459ed47ca3d8475aeb5744cfe39c88f0befa51 (patch)
tree61dd8a9d89d16251177aa33c0aa3fb9e37077d8b /gps-track
parent9c71b191c10df22b631953d67c994979a9000bd3 (diff)
gps-track: strip trailing binary zeros
Diffstat (limited to 'gps-track')
-rw-r--r--gps-track2
1 files changed, 2 insertions, 0 deletions
diff --git a/gps-track b/gps-track
index 5a828fd..158821d 100644
--- a/gps-track
+++ b/gps-track
@@ -11,6 +11,8 @@
:local Gps [ / system gps monitor once as-value ];
if ($Gps->"valid" = true) do={
+ :set ($Gps->"latitude") [ :pick ($Gps->"latitude") 0 [ :find ($Gps->"latitude") "\00" ] ];
+ :set ($Gps->"longitude") [ :pick ($Gps->"longitude") 0 [ :find ($Gps->"longitude") "\00" ] ];
:tool fetch mode=https check-certificate=yes-without-crl \
$GpsTrackUrl keep-result=no \
http-method=post http-content-type="application/json" \