diff options
author | ꦌꦫꦶꦏ꧀ꦦꦿꦧꦮꦑꦩꦭ꧀ <erik@darapsa.co.id> | 2021-07-14 18:26:00 +0800 |
---|---|---|
committer | ꦌꦫꦶꦏ꧀ꦦꦿꦧꦮꦑꦩꦭ꧀ <erik@darapsa.co.id> | 2021-07-14 18:26:00 +0800 |
commit | 3aab16c1b17edf43c74832a2fdbdf49980aa1c75 (patch) | |
tree | 58c93c600e25f521116f99b8bf455d2d49e9e1c8 /anteraja.c | |
parent | 1bd50fbe20f48e8eef4483a73f7467993d7870e2 (diff) | |
parent | 98e006f67c205a2674a1b35c3a215ba41ae1881b (diff) |
Merge branch 'master' into sicepat
Diffstat (limited to 'anteraja.c')
-rw-r--r-- | anteraja.c | 12 |
1 files changed, 1 insertions, 11 deletions
@@ -1,6 +1,3 @@ -#ifdef DEBUG -#include <stdio.h> -#endif #include "shipping.h" #include "handler.h" @@ -32,10 +29,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); -#ifdef DEBUG - printf("POST: %s\n", *post); -#endif + sprintf(*post, POST, origin, destination, weight < 1.0 ? 1000 : (int)weight * 1000); curl_easy_setopt(curl, CURLOPT_POSTFIELDS, *post); } @@ -43,10 +37,6 @@ size_t anteraja_services_handle(const char *contents, size_t size, size_t nmemb, struct pikul_services **services) { size_t realsize = size * nmemb; -#ifdef DEBUG - ((char *)contents)[realsize] = '\0'; - printf("%s\n", contents); -#endif handle_services(contents, realsize, status_trail, (const char *[]){ "content", "services", |