Skip to content

Commit

Permalink
Removing printf from Utils
Browse files Browse the repository at this point in the history
  • Loading branch information
LeStarch committed Jan 16, 2025
1 parent 3a4eb1d commit 5191501
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions Utils/CRCChecker.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,13 @@
// ======================================================================

#include <FpConfig.hpp>
#include <cstdio> // For snprintf
#include <Utils/CRCChecker.hpp>
#include <Fw/Types/Assert.hpp>
#include <Os/File.hpp>
#include <Os/FileSystem.hpp>
#include <Utils/Hash/Hash.hpp>
#include <Fw/Types/ExternalString.hpp>
#include <Fw/Types/StringUtils.hpp>

namespace Utils {

Expand All @@ -32,7 +33,6 @@ namespace Utils {
Os::File::Status stat;
Utils::Hash hash;
U32 checksum;
I32 s_stat;
FwSignedSizeType int_file_size;
FwSignedSizeType bytes_to_read;
FwSignedSizeType bytes_to_write;
Expand Down Expand Up @@ -90,8 +90,8 @@ namespace Utils {
hash.final(checksum);

// open checksum file
s_stat = snprintf(hashFilename, CRC_MAX_FILENAME_SIZE, "%s%s", fname, HASH_EXTENSION_STRING);
FW_ASSERT(s_stat > 0);
FW_ASSERT(CRC_MAX_FILENAME_SIZE > (Fw::StringUtils::string_length(fname, CRC_MAX_FILENAME_SIZE) + sizeof HASH_EXTENSION_STRING));
Fw::ExternalString(hashFilename, CRC_MAX_FILENAME_SIZE).format("%s%s", fname, HASH_EXTENSION_STRING);

stat = f.open(hashFilename, Os::File::OPEN_WRITE);
if(stat != Os::File::OP_OK)
Expand Down Expand Up @@ -120,8 +120,8 @@ namespace Utils {
char hashFilename[CRC_MAX_FILENAME_SIZE];
FW_ASSERT(fname != nullptr);
// open checksum file
I32 s_stat = snprintf(hashFilename, CRC_MAX_FILENAME_SIZE, "%s%s", fname, HASH_EXTENSION_STRING);
FW_ASSERT(s_stat > 0);
FW_ASSERT(CRC_MAX_FILENAME_SIZE > (Fw::StringUtils::string_length(fname, CRC_MAX_FILENAME_SIZE) + sizeof HASH_EXTENSION_STRING));
Fw::ExternalString(hashFilename, CRC_MAX_FILENAME_SIZE).format("%s%s", fname, HASH_EXTENSION_STRING);

stat = f.open(hashFilename, Os::File::OPEN_READ);
if(stat != Os::File::OP_OK)
Expand Down

0 comments on commit 5191501

Please sign in to comment.