]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
use g_ascii_isprint instead of c_isprint from gnulib
authorPavel Hrdina <phrdina@redhat.com>
Mon, 18 Nov 2019 14:14:47 +0000 (15:14 +0100)
committerPavel Hrdina <phrdina@redhat.com>
Tue, 10 Dec 2019 12:49:24 +0000 (13:49 +0100)
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Cole Robinson <crobinso@redhat.com>
src/qemu/qemu_agent.c
src/qemu/qemu_monitor.c
src/util/virstring.c
tools/vsh-table.c

index e6add56cd614c7a8e0db78fa9f9260acea350d04..5fa8d24a91868b21c96627c3236eb2c53e5bd7f4 100644 (file)
@@ -146,7 +146,6 @@ VIR_ONCE_GLOBAL_INIT(qemuAgent);
 
 
 #if DEBUG_RAW_IO
-# include <c-ctype.h>
 static char *
 qemuAgentEscapeNonPrintable(const char *text)
 {
@@ -155,7 +154,7 @@ qemuAgentEscapeNonPrintable(const char *text)
     for (i = 0; text[i] != '\0'; i++) {
         if (text[i] == '\\')
             virBufferAddLit(&buf, "\\\\");
-        else if (c_isprint(text[i]) || text[i] == '\n' ||
+        else if (g_ascii_isprint(text[i]) || text[i] == '\n' ||
                  (text[i] == '\r' && text[i+1] == '\n'))
             virBufferAddChar(&buf, text[i]);
         else
index 6e6678eb9bf987170b2f8f9f0649db3c16ef6436..ea3e62dc8ec8f33f8143be78cedeade64dbbc0ed 100644 (file)
@@ -199,14 +199,13 @@ VIR_ENUM_IMPL(qemuMonitorDumpStatus,
 
 
 #if DEBUG_RAW_IO
-# include <c-ctype.h>
 static char *
 qemuMonitorEscapeNonPrintable(const char *text)
 {
     size_t i;
     virBuffer buf = VIR_BUFFER_INITIALIZER;
     for (i = 0; text[i] != '\0'; i++) {
-        if (c_isprint(text[i]) ||
+        if (g_ascii_isprint(text[i]) ||
             text[i] == '\n' ||
             (text[i] == '\r' && text[i + 1] == '\n'))
             virBufferAddChar(&buf, text[i]);
index 40c83841e9b6cd431df249b86175bd64ad55eda5..a66b4062989d9d3d0a7305a0fc1d890c7eb000a8 100644 (file)
@@ -1350,7 +1350,7 @@ virStringIsPrintable(const char *str)
     size_t i;
 
     for (i = 0; str[i]; i++)
-        if (!c_isprint(str[i]))
+        if (!g_ascii_isprint(str[i]))
             return false;
 
     return true;
@@ -1369,7 +1369,7 @@ virStringBufferIsPrintable(const uint8_t *buf,
     size_t i;
 
     for (i = 0; i < buflen; i++)
-        if (!c_isprint(buf[i]))
+        if (!g_ascii_isprint(buf[i]))
             return false;
 
     return true;
index 28072c971948015af575cc856ba1df66f691c7c2..a2365b2c326e3b3cebce7afdee8ce8ef390db36b 100644 (file)
@@ -25,7 +25,6 @@
 #include <stddef.h>
 #include <wchar.h>
 #include <wctype.h>
-#include "c-ctype.h"
 
 #include "viralloc.h"
 #include "virbuffer.h"
@@ -244,7 +243,7 @@ vshTableSafeEncode(const char *s, size_t *width)
                  * Not valid multibyte sequence -- maybe it's
                  * printable char according to the current locales.
                  */
-                if (!c_isprint(*p)) {
+                if (!g_ascii_isprint(*p)) {
                     g_snprintf(buf, HEX_ENCODE_LENGTH + 1, "\\x%02x", *p);
                     buf += HEX_ENCODE_LENGTH;
                     *width += HEX_ENCODE_LENGTH;