Skip to content

Commit

Permalink
basic: define HEXDIGITS
Browse files Browse the repository at this point in the history
define HEXDIGITS alongside DIGITS, and use it where it's already useful.  We'll
use it again shortly when parsing MAC addresses.
  • Loading branch information
dkg committed May 17, 2016
1 parent 87c7c9d commit 1a7906a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/basic/string-util.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
#define UPPERCASE_LETTERS "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
#define LETTERS LOWERCASE_LETTERS UPPERCASE_LETTERS
#define ALPHANUMERICAL LETTERS DIGITS
#define HEXDIGITS DIGITS "abcdefABCDEF"

#define streq(a,b) (strcmp((a),(b)) == 0)
#define strneq(a, b, n) (strncmp((a), (b), (n)) == 0)
Expand Down
2 changes: 1 addition & 1 deletion src/test/test-fileio.c
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,7 @@ static void test_capeff(void) {

assert_se(r == 0);
assert_se(*capeff);
p = capeff[strspn(capeff, DIGITS "abcdefABCDEF")];
p = capeff[strspn(capeff, HEXDIGITS)];
assert_se(!p || isspace(p));
}
}
Expand Down

0 comments on commit 1a7906a

Please sign in to comment.