chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Prep v232.2: Mask more unneeded functions
[elogind.git]
/
src
/
basic
/
hexdecoct.c
diff --git
a/src/basic/hexdecoct.c
b/src/basic/hexdecoct.c
index 592df53cb56b9cee5e111c31ff0b7ad9092bc92d..c5bda6c4d68db6b69f2ec8a5d996f3928045ee98 100644
(file)
--- a/
src/basic/hexdecoct.c
+++ b/
src/basic/hexdecoct.c
@@
-25,6
+25,7
@@
#include "alloc-util.h"
#include "hexdecoct.h"
#include "macro.h"
#include "alloc-util.h"
#include "hexdecoct.h"
#include "macro.h"
+#include "util.h"
char octchar(int x) {
return '0' + (x & 7);
char octchar(int x) {
return '0' + (x & 7);
@@
-275,8
+276,8
@@
int unbase32hexmem(const char *p, size_t l, bool padding, void **mem, size_t *_l
if (padding) {
/* strip the padding */
while (l > 0 && p[l - 1] == '=' && pad < 7) {
if (padding) {
/* strip the padding */
while (l > 0 && p[l - 1] == '=' && pad < 7) {
- pad
++;
- l
--;
+ pad++;
+ l--;
}
}
}
}
@@
-504,7
+505,7
@@
int unbase64char(char c) {
if (c == '+')
return offset;
if (c == '+')
return offset;
- offset
++;
+ offset++;
if (c == '/')
return offset;
if (c == '/')
return offset;
@@
-572,7
+573,7
@@
static int base64_append_width(char **prefix, int plen,
if (!t)
return -ENOMEM;
if (!t)
return -ENOMEM;
- memcpy(t + plen, sep, slen);
+ memcpy
_safe
(t + plen, sep, slen);
for (line = 0, s = t + plen + slen, avail = len; line < lines; line++) {
int act = MIN(width, avail);
for (line = 0, s = t + plen + slen, avail = len; line < lines; line++) {
int act = MIN(width, avail);
@@
-620,9
+621,9
@@
int unbase64mem(const char *p, size_t l, void **mem, size_t *_len) {
/* strip the padding */
if (l > 0 && p[l - 1] == '=')
/* strip the padding */
if (l > 0 && p[l - 1] == '=')
- l
--;
+ l--;
if (l > 0 && p[l - 1] == '=')
if (l > 0 && p[l - 1] == '=')
- l
--;
+ l--;
/* a group of four input bytes needs three output bytes, in case of
padding we need to add two or three extra bytes */
/* a group of four input bytes needs three output bytes, in case of
padding we need to add two or three extra bytes */