From 937c27fc2373cd5649d69f72993ffeb342f5ef32 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gr=C3=A9gory=20Soutad=C3=A9?= Date: Thu, 5 Jan 2023 21:27:50 +0100 Subject: [PATCH] Fix some warnings --- src/libgourou.cpp | 2 +- utils/utils_common.cpp | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/libgourou.cpp b/src/libgourou.cpp index cdf3848..9210460 100644 --- a/src/libgourou.cpp +++ b/src/libgourou.cpp @@ -940,7 +940,7 @@ namespace gourou /* In adobekey.py, we get base64 decoded data [26:] */ ret = write(fd, privateLicenseKey.data()+26, privateLicenseKey.length()-26); close(fd); - if (ret != privateLicenseKey.length()-26) + if (ret != (int)(privateLicenseKey.length()-26)) { EXCEPTION(gourou::GOUROU_FILE_ERROR, "Error writing " << path); } diff --git a/utils/utils_common.cpp b/utils/utils_common.cpp index 41c0ac7..08ca3a2 100644 --- a/utils/utils_common.cpp +++ b/utils/utils_common.cpp @@ -98,7 +98,7 @@ void mkpath(const char *dir) void fileCopy(const char* in, const char* out) { - char buffer[4096]; + char buffer[4096], *_buffer; int ret, ret2, fdIn, fdOut; fdIn = open(in, O_RDONLY); @@ -121,11 +121,12 @@ void fileCopy(const char* in, const char* out) break; do { - ret2 = ::write(fdOut, buffer, ret); + _buffer = buffer; + ret2 = ::write(fdOut, _buffer, ret); if (ret2 >= 0) { ret -= ret2; - buffer += ret2; + _buffer += ret2; } else {