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 v229: Add missing fixes from upstream [1/6] src/basic
[elogind.git]
/
src
/
basic
/
escape.c
diff --git
a/src/basic/escape.c
b/src/basic/escape.c
index 9dbfa6d6e0f8c8143e6409fd45e2483ae9a1031e..2e483880c80c53996a73c9d9816c8cbcac524b0c 100644
(file)
--- a/
src/basic/escape.c
+++ b/
src/basic/escape.c
@@
-1,5
+1,3
@@
-/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
-
/***
This file is part of systemd.
/***
This file is part of systemd.
@@
-19,12
+17,15
@@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
+#include <errno.h>
+#include <stdlib.h>
+#include <string.h>
+
#include "alloc-util.h"
#include "escape.h"
#include "hexdecoct.h"
#include "alloc-util.h"
#include "escape.h"
#include "hexdecoct.h"
-#include "
string-util
.h"
+#include "
macro
.h"
#include "utf8.h"
#include "utf8.h"
-#include "util.h"
size_t cescape_char(char c, char *buf) {
char * buf_old = buf;
size_t cescape_char(char c, char *buf) {
char * buf_old = buf;
@@
-116,7
+117,7
@@
char *cescape(const char *s) {
return cescape_length(s, strlen(s));
}
return cescape_length(s, strlen(s));
}
-int cunescape_one(const char *p, size_t length,
uint
32_t *ret, bool *eight_bit) {
+int cunescape_one(const char *p, size_t length,
char
32_t *ret, bool *eight_bit) {
int r = 1;
assert(p);
int r = 1;
assert(p);
@@
-227,7
+228,7
@@
int cunescape_one(const char *p, size_t length, uint32_t *ret, bool *eight_bit)
int a[8];
unsigned i;
int a[8];
unsigned i;
-
uint
32_t c;
+
char
32_t c;
if (length != (size_t) -1 && length < 9)
return -EINVAL;
if (length != (size_t) -1 && length < 9)
return -EINVAL;
@@
-264,7
+265,7
@@
int cunescape_one(const char *p, size_t length, uint32_t *ret, bool *eight_bit)
case '7': {
/* octal encoding */
int a, b, c;
case '7': {
/* octal encoding */
int a, b, c;
-
uint
32_t m;
+
char
32_t m;
if (length != (size_t) -1 && length < 3)
return -EINVAL;
if (length != (size_t) -1 && length < 3)
return -EINVAL;
@@
-324,8
+325,8
@@
int cunescape_length_with_prefix(const char *s, size_t length, const char *prefi
for (f = s, t = r + pl; f < s + length; f++) {
size_t remaining;
for (f = s, t = r + pl; f < s + length; f++) {
size_t remaining;
- uint32_t u;
bool eight_bit = false;
bool eight_bit = false;
+ char32_t u;
int k;
remaining = s + length - f;
int k;
remaining = s + length - f;