From 0f1d933dd465dadffce0b3add5b1319f594077bc Mon Sep 17 00:00:00 2001 From: badcast Date: Sun, 19 Nov 2023 00:32:50 +0600 Subject: [PATCH] Fix: offset pointer --- src/net/tea_net_api.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/net/tea_net_api.c b/src/net/tea_net_api.c index 9f49b0f..d9aaaf4 100644 --- a/src/net/tea_net_api.c +++ b/src/net/tea_net_api.c @@ -127,13 +127,16 @@ int net_send(const char *url, const char *body, size_t len, struct net_responce_ if(net_result == CURLE_OK) { - for(int x = 0; x < receiver->size; ++x) + const char * p = receiver->raw_data; + const char * pe = p + receiver->size; + for(;p<=pe;) { - if(receiver->raw_data[x] == '{') + if(*p == '{') { - receiver->json_data = receiver->raw_data + x; + receiver->json_data = p; break; } + ++p; } } else