summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2018-05-17 10:04:24 +0200
committerSven Eden <yamakuzure@gmx.net>2018-08-24 16:47:08 +0200
commitcfbe7aeb009b9e220fde7ee61424e77fc37f18f6 (patch)
treee3fc2461a5e091dc196efab27f0b33c03a919e9c
parent164e559ea68e2b86994f44c339c5d118f1d678cf (diff)
basic/journal-importer: do not write non-unicode char to log
The type of cescape_char() is changed to int to make it easier to use in "%.*s". We know the value is between 1 and 4, so size_t is overkill.
-rw-r--r--src/basic/escape.c4
-rw-r--r--src/basic/escape.h2
2 files changed, 3 insertions, 3 deletions
diff --git a/src/basic/escape.c b/src/basic/escape.c
index 87d3be8ba..dc302364e 100644
--- a/src/basic/escape.c
+++ b/src/basic/escape.c
@@ -15,8 +15,8 @@
#include "macro.h"
#include "utf8.h"
-size_t cescape_char(char c, char *buf) {
- char * buf_old = buf;
+int cescape_char(char c, char *buf) {
+ char *buf_old = buf;
switch (c) {
diff --git a/src/basic/escape.h b/src/basic/escape.h
index 19a5bed90..7889dc714 100644
--- a/src/basic/escape.h
+++ b/src/basic/escape.h
@@ -45,7 +45,7 @@ typedef enum EscapeStyle {
char *cescape(const char *s);
char *cescape_length(const char *s, size_t n);
-size_t cescape_char(char c, char *buf);
+int cescape_char(char c, char *buf);
int cunescape(const char *s, UnescapeFlags flags, char **ret);
int cunescape_length(const char *s, size_t length, UnescapeFlags flags, char **ret);