Fix some warnings

This commit is contained in:
Grégory Soutadé 2023-01-05 21:27:50 +01:00
parent 34216d1b6e
commit 937c27fc23
2 changed files with 5 additions and 4 deletions

View File

@ -940,7 +940,7 @@ namespace gourou
/* In adobekey.py, we get base64 decoded data [26:] */ /* In adobekey.py, we get base64 decoded data [26:] */
ret = write(fd, privateLicenseKey.data()+26, privateLicenseKey.length()-26); ret = write(fd, privateLicenseKey.data()+26, privateLicenseKey.length()-26);
close(fd); close(fd);
if (ret != privateLicenseKey.length()-26) if (ret != (int)(privateLicenseKey.length()-26))
{ {
EXCEPTION(gourou::GOUROU_FILE_ERROR, "Error writing " << path); EXCEPTION(gourou::GOUROU_FILE_ERROR, "Error writing " << path);
} }

View File

@ -98,7 +98,7 @@ void mkpath(const char *dir)
void fileCopy(const char* in, const char* out) void fileCopy(const char* in, const char* out)
{ {
char buffer[4096]; char buffer[4096], *_buffer;
int ret, ret2, fdIn, fdOut; int ret, ret2, fdIn, fdOut;
fdIn = open(in, O_RDONLY); fdIn = open(in, O_RDONLY);
@ -121,11 +121,12 @@ void fileCopy(const char* in, const char* out)
break; break;
do do
{ {
ret2 = ::write(fdOut, buffer, ret); _buffer = buffer;
ret2 = ::write(fdOut, _buffer, ret);
if (ret2 >= 0) if (ret2 >= 0)
{ {
ret -= ret2; ret -= ret2;
buffer += ret2; _buffer += ret2;
} }
else else
{ {