Commit 9096df74fc89614125c00c2eb358c350eea96cdb

Authored by m-holger
Committed by Jay Berkenbilt
1 parent 6f15c8e7

Replace strchr in QUtil::is_hex_digit and is_space

Showing 1 changed file with 4 additions and 2 deletions
include/qpdf/QUtil.hh
@@ -545,13 +545,15 @@ namespace QUtil @@ -545,13 +545,15 @@ namespace QUtil
545 inline bool 545 inline bool
546 QUtil::is_hex_digit(char ch) 546 QUtil::is_hex_digit(char ch)
547 { 547 {
548 - return (ch && (strchr("0123456789abcdefABCDEF", ch) != nullptr)); 548 + return ('0' <= ch && ch <= '9') || ('a' <= ch && ch <= 'f') ||
  549 + ('A' <= ch && ch <= 'F');
549 } 550 }
550 551
551 inline bool 552 inline bool
552 QUtil::is_space(char ch) 553 QUtil::is_space(char ch)
553 { 554 {
554 - return (ch && (strchr(" \f\n\r\t\v", ch) != nullptr)); 555 + return ch == ' ' || ch == '\n' || ch == '\r' || ch == '\t' || ch == '\f' ||
  556 + ch == '\v';
555 } 557 }
556 558
557 inline bool 559 inline bool