[Pkg-gnupg-commit] [gnupg2] 121/185: common: New function print_utf9_string.
Daniel Kahn Gillmor
dkg at fifthhorseman.net
Mon Aug 7 11:55:28 UTC 2017
This is an automated email from the git hooks/post-receive script.
dkg pushed a commit to branch experimental
in repository gnupg2.
commit bddc2e04f1ddc18be20efc0f0508be401b345f42
Author: Werner Koch <wk at gnupg.org>
Date: Thu Jul 20 17:20:17 2017 +0200
common: New function print_utf9_string.
* common/miscellaneous.c (print_utf8_string): New.
--
This is a simple convenience function.
Signed-off-by: Werner Koch <wk at gnupg.org>
---
common/miscellaneous.c | 10 ++++++++++
common/util.h | 1 +
2 files changed, 11 insertions(+)
diff --git a/common/miscellaneous.c b/common/miscellaneous.c
index c9c603d..caeb66f 100644
--- a/common/miscellaneous.c
+++ b/common/miscellaneous.c
@@ -228,6 +228,16 @@ print_utf8_buffer (estream_t stream, const void *p, size_t n)
do_print_utf8_buffer (stream, p, n, NULL, NULL);
}
+
+void
+print_utf8_string (estream_t stream, const char *p)
+{
+ if (!p)
+ p = "";
+ do_print_utf8_buffer (stream, p, strlen (p), NULL, NULL);
+}
+
+
/* Write LENGTH bytes of BUFFER to FP as a hex encoded string.
RESERVED must be 0. */
void
diff --git a/common/util.h b/common/util.h
index c0aa57a..5b712d3 100644
--- a/common/util.h
+++ b/common/util.h
@@ -302,6 +302,7 @@ void print_utf8_buffer3 (estream_t fp, const void *p, size_t n,
const char *delim);
void print_utf8_buffer2 (estream_t fp, const void *p, size_t n, int delim);
void print_utf8_buffer (estream_t fp, const void *p, size_t n);
+void print_utf8_string (estream_t stream, const char *p);
void print_hexstring (FILE *fp, const void *buffer, size_t length,
int reserved);
char *try_make_printable_string (const void *p, size_t n, int delim);
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-gnupg/gnupg2.git
More information about the Pkg-gnupg-commit
mailing list