提交 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)
{
unsigned char c, d;
do {
while (*p == '0' && c_isxdigit(p[1]))
while (*p == '0' && g_ascii_isxdigit(p[1]))
++p;
while (*q == '0' && c_isxdigit(q[1]))
while (*q == '0' && g_ascii_isxdigit(q[1]))
++q;
c = c_tolower(*p);
d = c_tolower(*q);
......@@ -153,7 +153,7 @@ virMacAddrParse(const char* str, virMacAddrPtr addr)
/* This is solely to avoid accepting the leading
* space or "+" that strtoul would otherwise accept.
*/
if (!c_isxdigit(*str))
if (!g_ascii_isxdigit(*str))
break;
result = strtoul(str, &end_ptr, 16); /* exempt from syntax-check */
......
......@@ -1525,7 +1525,7 @@ virValidateWWN(const char *wwn)
p += 2;
for (i = 0; p[i]; i++) {
if (!c_isxdigit(p[i]))
if (!g_ascii_isxdigit(p[i]))
break;
}
......
......@@ -28,7 +28,6 @@
#include <time.h>
#include <unistd.h>
#include "c-ctype.h"
#include "internal.h"
#include "virutil.h"
#include "virerror.h"
......@@ -113,14 +112,14 @@ virUUIDParse(const char *uuidstr, unsigned char *uuid)
cur++;
continue;
}
if (!c_isxdigit(*cur))
if (!g_ascii_isxdigit(*cur))
goto error;
uuid[i] = virHexToBin(*cur);
uuid[i] *= 16;
cur++;
if (*cur == 0)
goto error;
if (!c_isxdigit(*cur))
if (!g_ascii_isxdigit(*cur))
goto error;
uuid[i] += virHexToBin(*cur);
i++;
......
......@@ -672,7 +672,7 @@ virVMXUnescapeHex(char *string, char escape)
/* Unescape from 'cXX' where c is the escape char and X is a hex digit */
while (*tmp1 != '\0') {
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;
*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.
先完成此消息的编辑!
想要评论请 注册