Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use "unsigned char" instead of "char" when comparing byte sequences #24

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions readtags.c
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ static int xdigitValue (char digit)
*/
static int readTagCharacter (const char **s)
{
int c = **s;
int c = **(const unsigned char **)s;

(*s)++;

Expand Down Expand Up @@ -160,7 +160,7 @@ static int taguppercmp (const char *s1, const char *s2)
int c1, c2;
do
{
c1 = *s1++;
c1 = (unsigned char)*s1++;
c2 = readTagCharacter (&s2);

result = toupper (c1) - toupper (c2);
Expand All @@ -174,7 +174,7 @@ static int tagnuppercmp (const char *s1, const char *s2, size_t n)
int c1, c2;
do
{
c1 = *s1++;
c1 = (unsigned char)*s1++;
c2 = readTagCharacter (&s2);

result = toupper (c1) - toupper (c2);
Expand All @@ -188,7 +188,7 @@ static int tagcmp (const char *s1, const char *s2)
int c1, c2;
do
{
c1 = *s1++;
c1 = (unsigned char)*s1++;
c2 = readTagCharacter (&s2);

result = c1 - c2;
Expand Down