projects
/
tinc
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
CI: add checks for basic compatibility with muon
[tinc]
/
src
/
utils.c
diff --git
a/src/utils.c
b/src/utils.c
index
5f40b8a
..
8655e2b
100644
(file)
--- a/
src/utils.c
+++ b/
src/utils.c
@@
-138,7
+138,7
@@
size_t b64decode_tinc(const char *src, void *dst, size_t length) {
unsigned char *udst = (unsigned char *)dst;
for(i = 0; i < length && src[i]; i++) {
unsigned char *udst = (unsigned char *)dst;
for(i = 0; i < length && src[i]; i++) {
- triplet |=
base64_decode[src[i] & 0xff] << (6 * (i & 3
));
+ triplet |=
(uint32_t)(base64_decode[src[i] & 0xff] << (6 * (i & 3)
));
if((i & 3) == 3) {
if(triplet & 0xff000000U) {
if((i & 3) == 3) {
if(triplet & 0xff000000U) {
@@
-373,3
+373,7
@@
FILE *fopenmask(const char *filename, const char *mode, mode_t perms) {
return f;
}
return f;
}
+bool string_eq(const char *first, const char *second) {
+ return !first == !second &&
+ !(first && second && strcmp(first, second));
+}