Simplify print statements by using HTTP_UNPACK

This commit is contained in:
2025-07-20 21:29:41 +02:00
parent 1c6c0a75cf
commit 3b196546da
4 changed files with 8 additions and 18 deletions
+1 -1
View File
@@ -43,7 +43,7 @@ int main(int argc, char **argv) {
}
printf("Status: %d\n", result->status);
printf("Body: %.*s\n", (int)result->body.len, result->body.ptr);
printf("Body: %.*s\n", HTTP_UNPACK(result->body));
http_request_free(reqs[i-1]);
}
+2 -2
View File
@@ -173,11 +173,11 @@ int main(int argc, char **argv)
if (url.len == 0) break;
if (is_already_crawled(url)) {
printf("Ignoring " RED "%.*s" RST "\n", (int) url.len, url.ptr);
printf("Ignoring " RED "%.*s" RST "\n", HTTP_UNPACK(url));
continue;
}
printf("Fetching " GRN "%.*s" RST "\n", (int) url.len, url.ptr);
printf("Fetching " GRN "%.*s" RST "\n", HTTP_UNPACK(url));
add_to_crawled_list(url);
HTTP_RequestHandle req;