Skip to content

Commit

Permalink
Use portable printf() format
Browse files Browse the repository at this point in the history
  • Loading branch information
SammyB428 committed Apr 28, 2020
1 parent 468200f commit 881d602
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion HEX.CPP
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ std::string Hex( uint32_t const value ) noexcept
{
char temp_string[ 65 ];

std::size_t const number_of_characters = ::sprintf( temp_string, "%04lX", static_cast<unsigned long>(value) );
std::size_t const number_of_characters = ::sprintf( temp_string, "%04" PRIX32, static_cast<unsigned long>(value) );

return( std::string(temp_string, number_of_characters) );
}
1 change: 1 addition & 0 deletions NMEA0183.H
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ SOFTWARE.
#include <charconv>
#include <math.h>
#include <time.h>
#include <inttypes.h>

#define STRING_VIEW(_x) std::string_view( _x, std::size(_x) - 1)

Expand Down

0 comments on commit 881d602

Please sign in to comment.