]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
virkeyfile: define IS_ASCII instead c_isascii from gnulib
authorPavel Hrdina <phrdina@redhat.com>
Wed, 20 Nov 2019 14:34:44 +0000 (15:34 +0100)
committerPavel Hrdina <phrdina@redhat.com>
Tue, 10 Dec 2019 12:49:23 +0000 (13:49 +0100)
GLib doesn't provide alternative to c_isascii and this is the only usage
of that macro so define a replacement ourselves.

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Cole Robinson <crobinso@redhat.com>
src/util/virkeyfile.c

index 705a193910e6709f29578d0cc13d52cf9977e5ec..7535c7cad21d8190566d2c1dcc6deb32776e444e 100644 (file)
@@ -78,6 +78,7 @@ struct _virKeyFileParserCtxt {
 #define IS_EOF (ctxt->cur >= ctxt->end)
 #define IS_EOL(c) (((c) == '\n') || ((c) == '\r'))
 #define IS_BLANK(c) (((c) == ' ') || ((c) == '\t'))
+#define IS_ASCII(c) ((c) < 128)
 #define CUR (*ctxt->cur)
 #define NEXT if (!IS_EOF) ctxt->cur++;
 
@@ -110,7 +111,7 @@ static int virKeyFileParseGroup(virKeyFileParserCtxtPtr ctxt)
     VIR_FREE(ctxt->groupname);
 
     name = ctxt->cur;
-    while (!IS_EOF && c_isascii(CUR) && CUR != ']')
+    while (!IS_EOF && IS_ASCII(CUR) && CUR != ']')
         ctxt->cur++;
     if (CUR != ']') {
         virKeyFileError(ctxt, VIR_ERR_CONF_SYNTAX, "cannot find end of group name, expected ']'");