diff options
author | Daniel Stenberg <daniel@haxx.se> | 2016-02-11 09:42:38 +0100 |
---|---|---|
committer | Daniel Stenberg <daniel@haxx.se> | 2016-02-11 09:44:45 +0100 |
commit | 3a6563d668406df1703edb4202afc038fcf9d30e (patch) | |
tree | 0fbb9438d99c13049f72b10c966583e582e4e238 /docs/examples/sampleconv.c | |
parent | 936d8f07dfbf2ac22ffd216f5363152bcecc2651 (diff) | |
download | curl-3a6563d668406df1703edb4202afc038fcf9d30e.tar.gz |
examples: adhere to curl code style
All plain C examples now (mostly) adhere to the curl code style. While
they are only examples, they had diverted so much and contained all
sorts of different mixed code styles by now. Having them use a unified
style helps users and readability. Also, as they get copy-and-pasted
widely by users, making sure they're clean and nice is a good idea.
573 checksrc warnings were addressed.
Diffstat (limited to 'docs/examples/sampleconv.c')
-rw-r--r-- | docs/examples/sampleconv.c | 27 |
1 files changed, 15 insertions, 12 deletions
diff --git a/docs/examples/sampleconv.c b/docs/examples/sampleconv.c index 1505ef2c6..eece6aae1 100644 --- a/docs/examples/sampleconv.c +++ b/docs/examples/sampleconv.c @@ -49,10 +49,11 @@ CURLcode my_conv_from_ascii_to_ebcdic(char *buffer, size_t length) int rc; tempptrin = tempptrout = buffer; rc = platform_a2e(&tempptrin, &bytes, &tempptrout, &bytes); - if (rc == PLATFORM_CONV_OK) { - return(CURLE_OK); - } else { - return(CURLE_CONV_FAILED); + if(rc == PLATFORM_CONV_OK) { + return CURLE_OK; + } + else { + return CURLE_CONV_FAILED; } } @@ -63,10 +64,11 @@ CURLcode my_conv_from_ebcdic_to_ascii(char *buffer, size_t length) int rc; tempptrin = tempptrout = buffer; rc = platform_e2a(&tempptrin, &bytes, &tempptrout, &bytes); - if (rc == PLATFORM_CONV_OK) { - return(CURLE_OK); - } else { - return(CURLE_CONV_FAILED); + if(rc == PLATFORM_CONV_OK) { + return CURLE_OK; + } + else { + return CURLE_CONV_FAILED; } } @@ -77,10 +79,11 @@ CURLcode my_conv_from_utf8_to_ebcdic(char *buffer, size_t length) int rc; tempptrin = tempptrout = buffer; rc = platform_u2e(&tempptrin, &bytes, &tempptrout, &bytes); - if (rc == PLATFORM_CONV_OK) { - return(CURLE_OK); - } else { - return(CURLE_CONV_FAILED); + if(rc == PLATFORM_CONV_OK) { + return CURLE_OK; + } + else { + return CURLE_CONV_FAILED; } } |