summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/bio/b_dump.c
diff options
context:
space:
mode:
authorbeck <>2014-04-19 00:41:38 +0000
committerbeck <>2014-04-19 00:41:38 +0000
commitf15b58ab9c9f635ba829753251c22b3da4683b00 (patch)
tree174c4c233f06a12ea563fd4e4c48bc26d4bdede3 /src/lib/libcrypto/bio/b_dump.c
parent4855ea84e69fe2edcf4d523233d15c950bd77e4d (diff)
downloadopenbsd-f15b58ab9c9f635ba829753251c22b3da4683b00.tar.gz
openbsd-f15b58ab9c9f635ba829753251c22b3da4683b00.tar.bz2
openbsd-f15b58ab9c9f635ba829753251c22b3da4683b00.zip
use intrinsic strlcpy and strlcat everywhere so we only have one set of
funcitons to check for incorrect use. keep BUF_strlcpy and BUF_strlcat for API comptibility only. ok tedu@
Diffstat (limited to '')
-rw-r--r--src/lib/libcrypto/bio/b_dump.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/lib/libcrypto/bio/b_dump.c b/src/lib/libcrypto/bio/b_dump.c
index ff75069df8..61c9fe20a3 100644
--- a/src/lib/libcrypto/bio/b_dump.c
+++ b/src/lib/libcrypto/bio/b_dump.c
@@ -107,29 +107,29 @@ BIO_dump_indent_cb(int (*cb)(const void *data, size_t len, void *u),
107 rows++; 107 rows++;
108 for (i = 0; i < rows; i++) { 108 for (i = 0; i < rows; i++) {
109 buf[0] = '\0'; /* start with empty string */ 109 buf[0] = '\0'; /* start with empty string */
110 BUF_strlcpy(buf, str, sizeof buf); 110 strlcpy(buf, str, sizeof buf);
111 (void) snprintf(tmp, sizeof tmp, "%04x - ", i*dump_width); 111 (void) snprintf(tmp, sizeof tmp, "%04x - ", i*dump_width);
112 BUF_strlcat(buf, tmp, sizeof buf); 112 strlcat(buf, tmp, sizeof buf);
113 for (j = 0; j < dump_width; j++) { 113 for (j = 0; j < dump_width; j++) {
114 if (((i*dump_width) + j) >= len) { 114 if (((i*dump_width) + j) >= len) {
115 BUF_strlcat(buf, " ", sizeof buf); 115 strlcat(buf, " ", sizeof buf);
116 } else { 116 } else {
117 ch = ((unsigned char)*(s + i*dump_width + j)) & 0xff; 117 ch = ((unsigned char)*(s + i*dump_width + j)) & 0xff;
118 (void) snprintf(tmp, sizeof tmp, "%02x%c", ch, 118 (void) snprintf(tmp, sizeof tmp, "%02x%c", ch,
119 j == 7 ? '-' : ' '); 119 j == 7 ? '-' : ' ');
120 BUF_strlcat(buf, tmp, sizeof buf); 120 strlcat(buf, tmp, sizeof buf);
121 } 121 }
122 } 122 }
123 BUF_strlcat(buf, " ", sizeof buf); 123 strlcat(buf, " ", sizeof buf);
124 for (j = 0; j < dump_width; j++) { 124 for (j = 0; j < dump_width; j++) {
125 if (((i*dump_width) + j) >= len) 125 if (((i*dump_width) + j) >= len)
126 break; 126 break;
127 ch = ((unsigned char)*(s + i * dump_width + j)) & 0xff; 127 ch = ((unsigned char)*(s + i * dump_width + j)) & 0xff;
128 (void) snprintf(tmp, sizeof tmp, "%c", 128 (void) snprintf(tmp, sizeof tmp, "%c",
129 ((ch >= ' ') && (ch <= '~')) ? ch : '.'); 129 ((ch >= ' ') && (ch <= '~')) ? ch : '.');
130 BUF_strlcat(buf, tmp, sizeof buf); 130 strlcat(buf, tmp, sizeof buf);
131 } 131 }
132 BUF_strlcat(buf, "\n", sizeof buf); 132 strlcat(buf, "\n", sizeof buf);
133 /* if this is the last call then update the ddt_dump thing so 133 /* if this is the last call then update the ddt_dump thing so
134 * that we will move the selection point in the debug window 134 * that we will move the selection point in the debug window
135 */ 135 */