Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ int32_t mono_wasi_load_icu_data(const void* pData)
static int32_t load_icu_data(const void* pData)
{

UErrorCode status = 0;
UErrorCode status = U_ZERO_ERROR;
udata_setCommonData(pData, &status);

if (U_FAILURE(status))
Expand All @@ -108,6 +108,7 @@ static const char *
cstdlib_load_icu_data(const char *path)
{
char *file_buf = NULL;
long file_buf_size = 0;
FILE *fp = fopen(path, "rb");

if (fp == NULL)
Expand All @@ -122,15 +123,15 @@ cstdlib_load_icu_data(const char *path)
goto error;
}

long file_buf_size = ftell(fp);
file_buf_size = ftell(fp);

if (file_buf_size == -1)
{
log_shim_error("Unable to determine size of the ICU dat file.");
goto error;
}

file_buf = malloc(sizeof(char) * (unsigned long)(file_buf_size + 1));
file_buf = (char*)malloc(sizeof(char) * (unsigned long)(file_buf_size + 1));

if (file_buf == NULL)
{
Expand Down Expand Up @@ -223,7 +224,7 @@ int32_t GlobalizationNative_LoadICU(void)
}
#endif

UErrorCode status = 0;
UErrorCode status = U_ZERO_ERROR;
UVersionInfo version;
// Request the CLDR version to perform basic ICU initialization and find out
// whether it worked.
Expand Down
2 changes: 1 addition & 1 deletion src/native/libs/System.Native/pal_networking.c
Original file line number Diff line number Diff line change
Expand Up @@ -3635,6 +3635,7 @@ int32_t SystemNative_SendFile(intptr_t out_fd, intptr_t in_fd, int64_t offset, i
// Emulate sendfile using a simple read/send loop.
*sent = 0;
char* buffer = NULL;
size_t bufferLength = Min((size_t)count, 80 * 1024 * sizeof(char));

// Save the original input file position and seek to the offset position
off_t inputFileOrigOffset = lseek(infd, 0, SEEK_CUR);
Expand All @@ -3644,7 +3645,6 @@ int32_t SystemNative_SendFile(intptr_t out_fd, intptr_t in_fd, int64_t offset, i
}

// Allocate a buffer
size_t bufferLength = Min((size_t)count, 80 * 1024 * sizeof(char));
buffer = (char*)malloc(bufferLength);
if (buffer == NULL)
{
Expand Down
Loading