]> gitweb.hhaalo.de Git - sane-kds-s2000w-net.git/commitdiff
fix realloc callback
authorBastian Dehn <hhaalo@arcor.de>
Fri, 14 Feb 2025 11:01:02 +0000 (12:01 +0100)
committerBastian Dehn <hhaalo@arcor.de>
Fri, 14 Feb 2025 11:01:02 +0000 (12:01 +0100)
src/kds_s2000w_client.c

index 934d4d6ce31d47758f58c9896ad8a51e1c58c53f..08e2fd7bdea81be053267aa22d6d6050f2ce9610 100644 (file)
@@ -30,7 +30,7 @@ size_t _kds_s2000w_client_write_callback(char* ptr, size_t size, size_t nmemb, v
 {
        response* resp = (response*) data;
 
-       resp->data = realloc(resp->data, resp->size + size * nmemb + 1);
+       resp->data = realloc(resp->data, resp->size + size * nmemb);
        char* respdata = (char*) resp->data;
        memcpy(&respdata[resp->size], ptr, size * nmemb);
        resp->size += size * nmemb;