diff --git a/src/RagePhoto.cpp b/src/RagePhoto.cpp index 136e61f..b77e1fe 100644 --- a/src/RagePhoto.cpp +++ b/src/RagePhoto.cpp @@ -352,7 +352,7 @@ bool RagePhoto::load(const char *data, size_t length, RagePhotoData *rp_data, Ra rp_data->error = Error::IncompleteJpegMarker; // 12 return false; } - if (strncmp(markerBuffer, "JPEG", 4) != 0) { + if (std::memcmp(markerBuffer, "JPEG", 4) != 0) { rp_data->error = Error::IncorrectJpegMarker; // 13 return false; } @@ -398,7 +398,7 @@ bool RagePhoto::load(const char *data, size_t length, RagePhotoData *rp_data, Ra rp_data->error = Error::IncompleteJsonMarker; // 18 return false; } - if (strncmp(markerBuffer, "JSON", 4) != 0) { + if (std::memcmp(markerBuffer, "JSON", 4) != 0) { rp_data->error = Error::IncorrectJsonMarker; // 19 return false; } @@ -433,7 +433,7 @@ bool RagePhoto::load(const char *data, size_t length, RagePhotoData *rp_data, Ra rp_data->error = Error::IncompleteTitleMarker; // 23 return false; } - if (strncmp(markerBuffer, "TITL", 4) != 0) { + if (std::memcmp(markerBuffer, "TITL", 4) != 0) { rp_data->error = Error::IncorrectTitleMarker; // 24 return false; } @@ -468,7 +468,7 @@ bool RagePhoto::load(const char *data, size_t length, RagePhotoData *rp_data, Ra rp_data->error = Error::IncompleteDescMarker; // 28 return false; } - if (strncmp(markerBuffer, "DESC", 4) != 0) { + if (std::memcmp(markerBuffer, "DESC", 4) != 0) { rp_data->error = Error::IncorrectDescMarker; // 29 return false; } @@ -503,7 +503,7 @@ bool RagePhoto::load(const char *data, size_t length, RagePhotoData *rp_data, Ra rp_data->error = Error::IncompleteJendMarker; // 33 return false; } - if (strncmp(markerBuffer, "JEND", 4) != 0) { + if (std::memcmp(markerBuffer, "JEND", 4) != 0) { rp_data->error = Error::IncorrectJendMarker; // 34 return false; } diff --git a/src/RagePhoto.h b/src/RagePhoto.h index 699d0c0..e8727f8 100644 --- a/src/RagePhoto.h +++ b/src/RagePhoto.h @@ -115,7 +115,7 @@ public: int32_t error() const; /**< Returns the last error occurred. */ uint32_t format() const; /**< Returns the Photo Format (GTA V or RDR 2). */ const std::string jpeg() const; /**< Returns the Photo JPEG data. */ - const char *jpegData() const; /**< Returns the Photo JPEG data. */ + const char* jpegData() const; /**< Returns the Photo JPEG data. */ uint32_t jpegSize() const; /**< Returns the Photo JPEG data size. */ const char* description() const; /**< Returns the Photo description. */ const char* json() const; /**< Returns the Photo JSON data. */ diff --git a/src/RagePhotoA.h b/src/RagePhotoA.h index 5fe16d5..9a164d9 100644 --- a/src/RagePhotoA.h +++ b/src/RagePhotoA.h @@ -28,7 +28,7 @@ * \brief ABI Stable Wrapper for RagePhoto. * * Using RagePhotoA instead of RagePhoto allows your library or application to survive more changes in the RagePhoto class, -* disadvantages include worse performance, which should be pretty minimal, and not always include the newest features. +* disadvantages include that it doesn't always include the newest features, performance is about the same. */ class RagePhotoA { @@ -150,7 +150,7 @@ public: return std::string(ragephoto_getphotojpeg(instance), ragephoto_getphotosize(instance)); } /** Returns the Photo JPEG data. */ - const char *jpegData() const { + const char* jpegData() const { return ragephoto_getphotojpeg(instance); } /** Returns the Photo JPEG data size. */