提交 51c2bc4b 编写于 作者: P Pavel Hrdina

use g_ascii_isxdigit instead of c_isxdigit from gnulib

Signed-off-by: NPavel Hrdina <phrdina@redhat.com>
Reviewed-by: NCole Robinson <crobinso@redhat.com>
上级 caab1fbd
...@@ -38,9 +38,9 @@ virMacAddrCompare(const char *p, const char *q) ...@@ -38,9 +38,9 @@ virMacAddrCompare(const char *p, const char *q)
{ {
unsigned char c, d; unsigned char c, d;
do { do {
while (*p == '0' && c_isxdigit(p[1])) while (*p == '0' && g_ascii_isxdigit(p[1]))
++p; ++p;
while (*q == '0' && c_isxdigit(q[1])) while (*q == '0' && g_ascii_isxdigit(q[1]))
++q; ++q;
c = c_tolower(*p); c = c_tolower(*p);
d = c_tolower(*q); d = c_tolower(*q);
...@@ -153,7 +153,7 @@ virMacAddrParse(const char* str, virMacAddrPtr addr) ...@@ -153,7 +153,7 @@ virMacAddrParse(const char* str, virMacAddrPtr addr)
/* This is solely to avoid accepting the leading /* This is solely to avoid accepting the leading
* space or "+" that strtoul would otherwise accept. * space or "+" that strtoul would otherwise accept.
*/ */
if (!c_isxdigit(*str)) if (!g_ascii_isxdigit(*str))
break; break;
result = strtoul(str, &end_ptr, 16); /* exempt from syntax-check */ result = strtoul(str, &end_ptr, 16); /* exempt from syntax-check */
......
...@@ -1525,7 +1525,7 @@ virValidateWWN(const char *wwn) ...@@ -1525,7 +1525,7 @@ virValidateWWN(const char *wwn)
p += 2; p += 2;
for (i = 0; p[i]; i++) { for (i = 0; p[i]; i++) {
if (!c_isxdigit(p[i])) if (!g_ascii_isxdigit(p[i]))
break; break;
} }
......
...@@ -28,7 +28,6 @@ ...@@ -28,7 +28,6 @@
#include <time.h> #include <time.h>
#include <unistd.h> #include <unistd.h>
#include "c-ctype.h"
#include "internal.h" #include "internal.h"
#include "virutil.h" #include "virutil.h"
#include "virerror.h" #include "virerror.h"
...@@ -113,14 +112,14 @@ virUUIDParse(const char *uuidstr, unsigned char *uuid) ...@@ -113,14 +112,14 @@ virUUIDParse(const char *uuidstr, unsigned char *uuid)
cur++; cur++;
continue; continue;
} }
if (!c_isxdigit(*cur)) if (!g_ascii_isxdigit(*cur))
goto error; goto error;
uuid[i] = virHexToBin(*cur); uuid[i] = virHexToBin(*cur);
uuid[i] *= 16; uuid[i] *= 16;
cur++; cur++;
if (*cur == 0) if (*cur == 0)
goto error; goto error;
if (!c_isxdigit(*cur)) if (!g_ascii_isxdigit(*cur))
goto error; goto error;
uuid[i] += virHexToBin(*cur); uuid[i] += virHexToBin(*cur);
i++; i++;
......
...@@ -672,7 +672,7 @@ virVMXUnescapeHex(char *string, char escape) ...@@ -672,7 +672,7 @@ virVMXUnescapeHex(char *string, char escape)
/* Unescape from 'cXX' where c is the escape char and X is a hex digit */ /* Unescape from 'cXX' where c is the escape char and X is a hex digit */
while (*tmp1 != '\0') { while (*tmp1 != '\0') {
if (*tmp1 == escape) { if (*tmp1 == escape) {
if (!c_isxdigit(tmp1[1]) || !c_isxdigit(tmp1[2])) if (!g_ascii_isxdigit(tmp1[1]) || !g_ascii_isxdigit(tmp1[2]))
return -1; return -1;
*tmp2++ = virHexToBin(tmp1[1]) * 16 + virHexToBin(tmp1[2]); *tmp2++ = virHexToBin(tmp1[1]) * 16 + virHexToBin(tmp1[2]);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册