Skip to content

Commit

Permalink
Make the path length a constant.
Browse files Browse the repository at this point in the history
  • Loading branch information
0xFireWolf committed Jul 16, 2021
1 parent 457d4ee commit ab1e15e
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions RealtekCardReaderFriend/RealtekCardReaderFriend.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@

static const char* kCardReaderReporterPath = "/System/Library/SystemProfiler/SPCardReaderReporter.spreporter";

static const size_t kCardReaderReporterPathLength = strlen(kCardReaderReporterPath);

// MARK: PCIe-based Card Reader

// Function: SPCardReaderReporter::updateDictionary()
Expand Down Expand Up @@ -113,10 +115,10 @@ static const uint8_t kRealtekUCRBundleIdentifier[] =

static inline bool matchReporterPath(const char* path)
{
return strncmp(path, kCardReaderReporterPath, strlen(kCardReaderReporterPath)) == 0;
return strncmp(path, kCardReaderReporterPath, kCardReaderReporterPathLength) == 0;
}

static inline void patchReporter(const void* data, vm_size_t size)
static void patchReporter(const void* data, vm_size_t size)
{
void* memory = const_cast<void*>(data);

Expand Down

0 comments on commit ab1e15e

Please sign in to comment.