From 194ca9221d44acc98007251d845899890b57b4ce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=A6=8C=EA=A6=AB=EA=A6=B6=EA=A6=8F=EA=A7=80=EA=A6=A6?= =?UTF-8?q?=EA=A6=BF=EA=A6=A7=EA=A6=AE=EA=A6=91=EA=A6=A9=EA=A6=AD=EA=A7=80?= Date: Mon, 19 Jul 2021 19:03:56 +0800 Subject: Minimum total weight is 1kg --- anteraja.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'anteraja.c') diff --git a/anteraja.c b/anteraja.c index 87438dd..a2e4562 100644 --- a/anteraja.c +++ b/anteraja.c @@ -138,10 +138,11 @@ void anteraja_order(const char *order_number, const char *service, const char *s + strlen(receiver_phone) + strlen(destination) + strlen(receiver_address) + strlen(receiver_postal) + strlen(json) + ORDER_INSURANCE + ORDER_SUBTOTAL - 15 * strlen("%s") - 2 * strlen("%d") + 1); - sprintf(shipping.post, ORDER_POST, prefix, order_number, service, (int)total_weight, sender_name, - sender_phone, origin, sender_address, sender_postal, receiver_name, receiver_phone, - destination, receiver_address, receiver_postal, json, - total_weight < 1000.0 ? "true" : "false", subtotal < 1000.0 ? 1000 : (int)subtotal); + sprintf(shipping.post, ORDER_POST, prefix, order_number, service, + total_weight < 1000.0 ? 1000 : (int)total_weight, sender_name, sender_phone, + origin, sender_address, sender_postal, receiver_name, receiver_phone, destination, + receiver_address, receiver_postal, json, total_weight < 1000.0 ? "true" : "false", + subtotal < 1000.0 ? 1000 : (int)subtotal); static const char *trail[] = { "content", "waybill_no", -- cgit v1.2.3