summaryrefslogtreecommitdiff
path: root/anteraja.c
diff options
context:
space:
mode:
Diffstat (limited to 'anteraja.c')
-rw-r--r--anteraja.c12
1 files changed, 1 insertions, 11 deletions
diff --git a/anteraja.c b/anteraja.c
index e0c53cf..462ff5d 100644
--- a/anteraja.c
+++ b/anteraja.c
@@ -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",