projects
/
tinc
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
CI: use compilation database for clang-tidy job
[tinc]
/
src
/
gcrypt
/
pem.c
diff --git
a/src/gcrypt/pem.c
b/src/gcrypt/pem.c
index
b2eca3d
..
56858f2
100644
(file)
--- a/
src/gcrypt/pem.c
+++ b/
src/gcrypt/pem.c
@@
-93,11
+93,11
@@
bool pem_encode(FILE *fp, const char *header, uint8_t *buf, size_t size) {
return false;
}
return false;
}
- char
b64[B64_SIZE(size)]
;
+ char
*b64 = alloca(B64_SIZE(size))
;
const size_t b64len = b64encode(b64, buf, size);
const size_t b64len = b64encode(b64, buf, size);
- for(
char *p = b64; p < b64 + b64len; p
+= 64) {
- if(fprintf(fp, "%.64s\n",
p
) <= 0) {
+ for(
size_t i = 0; i < b64len; i
+= 64) {
+ if(fprintf(fp, "%.64s\n",
&b64[i]
) <= 0) {
return false;
}
}
return false;
}
}