diff options
author | Pavel Hrdina <phrdina@redhat.com> | 2019-11-13 14:53:42 +0100 |
---|---|---|
committer | Pavel Hrdina <phrdina@redhat.com> | 2019-11-15 15:07:40 +0100 |
commit | 43b01ef2d6611984724e25ae983bf3721ac2f8ef (patch) | |
tree | 2a14e3065f9ea6775ec9afdaa1d8586ab244ba22 /tools/vsh-table.c | |
parent | 8addef2bef0a4c7f42c71a78edfbe27d32e26db1 (diff) | |
download | libvirt-43b01ef2d6611984724e25ae983bf3721ac2f8ef.tar.gz |
replace use of gnulib snprintf by g_snprintf
Glib implementation follows the ISO C99 standard so it's safe to replace
the gnulib implementation.
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
Diffstat (limited to 'tools/vsh-table.c')
-rw-r--r-- | tools/vsh-table.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/tools/vsh-table.c b/tools/vsh-table.c index c2271a4e2d..9008b0d431 100644 --- a/tools/vsh-table.c +++ b/tools/vsh-table.c @@ -227,7 +227,7 @@ vshTableSafeEncode(const char *s, size_t *width) while (p && *p) { if ((*p == '\\' && *(p + 1) == 'x') || c_iscntrl(*p)) { - snprintf(buf, HEX_ENCODE_LENGTH + 1, "\\x%02x", *p); + g_snprintf(buf, HEX_ENCODE_LENGTH + 1, "\\x%02x", *p); buf += HEX_ENCODE_LENGTH; *width += HEX_ENCODE_LENGTH; p++; @@ -245,7 +245,7 @@ vshTableSafeEncode(const char *s, size_t *width) * printable char according to the current locales. */ if (!c_isprint(*p)) { - snprintf(buf, HEX_ENCODE_LENGTH + 1, "\\x%02x", *p); + g_snprintf(buf, HEX_ENCODE_LENGTH + 1, "\\x%02x", *p); buf += HEX_ENCODE_LENGTH; *width += HEX_ENCODE_LENGTH; } else { @@ -255,7 +255,7 @@ vshTableSafeEncode(const char *s, size_t *width) } else if (!iswprint(wc)) { size_t i; for (i = 0; i < len; i++) { - snprintf(buf, HEX_ENCODE_LENGTH + 1, "\\x%02x", p[i]); + g_snprintf(buf, HEX_ENCODE_LENGTH + 1, "\\x%02x", p[i]); buf += HEX_ENCODE_LENGTH; *width += HEX_ENCODE_LENGTH; } |