summaryrefslogtreecommitdiff
path: root/docs/examples/debug.c
diff options
context:
space:
mode:
authorng0 <ng0@infotropique.org>2017-10-06 14:15:34 +0000
committerng0 <ng0@infotropique.org>2017-10-06 14:15:34 +0000
commit64d20516fc61405cf0de4db0b0b8c52b3cafe917 (patch)
tree804233b6e02880b5774b9cc3a015ddaeb036717a /docs/examples/debug.c
parentdc3acc1603d57da12f54d5e360e40eda12b1066c (diff)
parent3ea76790571c1f7cf1bed34fabffd3cc20ad3dd3 (diff)
downloadgnurl-64d20516fc61405cf0de4db0b0b8c52b3cafe917.tar.gz
gnurl-64d20516fc61405cf0de4db0b0b8c52b3cafe917.tar.bz2
gnurl-64d20516fc61405cf0de4db0b0b8c52b3cafe917.zip
Merge tag 'curl-7_56_0'
curl 7.56.0
Diffstat (limited to 'docs/examples/debug.c')
-rw-r--r--docs/examples/debug.c24
1 files changed, 13 insertions, 11 deletions
diff --git a/docs/examples/debug.c b/docs/examples/debug.c
index 8a490a281..8f77e1243 100644
--- a/docs/examples/debug.c
+++ b/docs/examples/debug.c
@@ -5,7 +5,7 @@
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
- * Copyright (C) 1998 - 2016, Daniel Stenberg, <daniel@haxx.se>, et al.
+ * Copyright (C) 1998 - 2017, Daniel Stenberg, <daniel@haxx.se>, et al.
*
* This software is licensed as described in the file COPYING, which
* you should have received as part of this distribution. The terms
@@ -38,7 +38,7 @@ void dump(const char *text,
size_t i;
size_t c;
- unsigned int width=0x10;
+ unsigned int width = 0x10;
if(nohex)
/* without the hex output, we can fit more on screen */
@@ -47,30 +47,32 @@ void dump(const char *text,
fprintf(stream, "%s, %10.10ld bytes (0x%8.8lx)\n",
text, (long)size, (long)size);
- for(i=0; i<size; i+= width) {
+ for(i = 0; i<size; i += width) {
fprintf(stream, "%4.4lx: ", (long)i);
if(!nohex) {
/* hex not disabled, show it */
for(c = 0; c < width; c++)
- if(i+c < size)
- fprintf(stream, "%02x ", ptr[i+c]);
+ if(i + c < size)
+ fprintf(stream, "%02x ", ptr[i + c]);
else
fputs(" ", stream);
}
- for(c = 0; (c < width) && (i+c < size); c++) {
+ for(c = 0; (c < width) && (i + c < size); c++) {
/* check for 0D0A; if found, skip past and start a new line of output */
- if(nohex && (i+c+1 < size) && ptr[i+c]==0x0D && ptr[i+c+1]==0x0A) {
- i+=(c+2-width);
+ if(nohex && (i + c + 1 < size) && ptr[i + c] == 0x0D &&
+ ptr[i + c + 1] == 0x0A) {
+ i += (c + 2 - width);
break;
}
fprintf(stream, "%c",
- (ptr[i+c]>=0x20) && (ptr[i+c]<0x80)?ptr[i+c]:'.');
+ (ptr[i + c] >= 0x20) && (ptr[i + c]<0x80)?ptr[i + c]:'.');
/* check again for 0D0A, to avoid an extra \n if it's at width */
- if(nohex && (i+c+2 < size) && ptr[i+c+1]==0x0D && ptr[i+c+2]==0x0A) {
- i+=(c+3-width);
+ if(nohex && (i + c + 2 < size) && ptr[i + c + 1] == 0x0D &&
+ ptr[i + c + 2] == 0x0A) {
+ i += (c + 3 - width);
break;
}
}