From: Haydar Alaidrus Date: Sat, 23 Dec 2023 19:28:06 +0000 (+0700) Subject: CURLOPT_POSTFIELDS.3: fix incorrect C string escape in example X-Git-Tag: curl-8_6_0~174 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=9faeebca883b3d8a57ca291e4f1b80382e236b5a;p=thirdparty%2Fcurl.git CURLOPT_POSTFIELDS.3: fix incorrect C string escape in example - Escape inner quotes with two backslashes. Two backslashes escapes the backslash for the man page and will show as a single backslash. eg: "{\\"name\\": \\"daniel\\"}" shows as "{\"name\": \"daniel\"}". Closes https://github.com/curl/curl/pull/12588 --- diff --git a/docs/libcurl/opts/CURLOPT_POSTFIELDS.3 b/docs/libcurl/opts/CURLOPT_POSTFIELDS.3 index c42cd65fbf..6efdb95316 100644 --- a/docs/libcurl/opts/CURLOPT_POSTFIELDS.3 +++ b/docs/libcurl/opts/CURLOPT_POSTFIELDS.3 @@ -97,7 +97,7 @@ int main(void) /* send an application/json POST */ curl = curl_easy_init(); if(curl) { - const char *json = "{\"name\": \"daniel\"}"; + const char *json = "{\\"name\\": \\"daniel\\"}"; struct curl_slist *slist1 = NULL; slist1 = curl_slist_append(slist1, "Content-Type: application/json"); slist1 = curl_slist_append(slist1, "Accept: application/json");