mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-03-20 06:50:22 +03:00
use g_ascii_isxdigit instead of c_isxdigit from gnulib
Signed-off-by: Pavel Hrdina <phrdina@redhat.com> Reviewed-by: Cole Robinson <crobinso@redhat.com>
This commit is contained in:
parent
caab1fbd67
commit
51c2bc4ba9
@ -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]);
|
||||
|
Loading…
x
Reference in New Issue
Block a user