summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorꦌꦫꦶꦏ꧀ꦦꦿꦧꦮꦑꦩꦭ꧀ <erik@darapsa.co.id>2021-07-14 17:31:40 +0800
committerꦌꦫꦶꦏ꧀ꦦꦿꦧꦮꦑꦩꦭ꧀ <erik@darapsa.co.id>2021-07-14 17:31:40 +0800
commitc94ad9f218da96aa57098a0560247e23d5a954b7 (patch)
tree7647aa5034729057dfc2a722d6816fa8fbf0769c
parent74ccf9e85a81f2347730103108cc0b9d773e5f3c (diff)
By default, Anteraja will not round up to minimum
-rw-r--r--anteraja.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/anteraja.c b/anteraja.c
index c84ab9d..5e5111d 100644
--- a/anteraja.c
+++ b/anteraja.c
@@ -32,7 +32,7 @@ void anteraja_services(const char *origin, const char *destination, double weigh
sprintf(*url, "%s%s", shipping->base, path);
*post = malloc(strlen(POST) + strlen(origin) + strlen(destination) + strlen("50000")
- 2 * strlen("%s") - strlen("%d") + 1);
- sprintf(*post, POST, origin, destination, (int)weight * 1000);
+ sprintf(*post, POST, origin, destination, weight < 1.0 ? 1000 : (int)weight * 1000);
curl_easy_setopt(curl, CURLOPT_POSTFIELDS, *post);
}