From d44245164a660e27bb48abdc99b461bf028579fa Mon Sep 17 00:00:00 2001 From: Natalia Portillo Date: Thu, 20 May 2021 16:34:52 +0100 Subject: [PATCH] Change how data is written to files in Carbon, to ensure the returned integer equals the number of bytes written. --- setter/src/unix/darwin/carbon.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/setter/src/unix/darwin/carbon.c b/setter/src/unix/darwin/carbon.c index 1be3d15..f6e9606 100644 --- a/setter/src/unix/darwin/carbon.c +++ b/setter/src/unix/darwin/carbon.c @@ -236,7 +236,7 @@ int CarbonResourceFork(const char* path) if(f != NULL) { txtLen = strlen(icnsText); - written = fwrite(icnsText, txtLen, 1, f); + written = fwrite(icnsText, 1, txtLen, f); wRc = written != txtLen ? errno : 0; cRc = fclose(f); @@ -295,7 +295,7 @@ int CarbonResourceFork(const char* path) if(f != NULL) { txtLen = strlen(pictText); - written = fwrite(pictText, txtLen, 1, f); + written = fwrite(pictText, 1, txtLen, f); wRc = written != txtLen ? errno : 0; cRc = fclose(f); @@ -354,7 +354,7 @@ int CarbonResourceFork(const char* path) if(f != NULL) { txtLen = strlen(versText); - written = fwrite(versText, txtLen, 1, f); + written = fwrite(versText, 1, txtLen, f); wRc = written != txtLen ? errno : 0; cRc = fclose(f); @@ -442,7 +442,7 @@ int CarbonResourceFork(const char* path) if(f != NULL) { txtLen = strlen(rsrcText); - written = fwrite(rsrcText, txtLen, 1, f); + written = fwrite(rsrcText, 1, txtLen, f); wRc = written != txtLen ? errno : 0; cRc = fclose(f);