diff --git a/contrib/kolibri-libc/source/stdio/fread.c b/contrib/kolibri-libc/source/stdio/fread.c index 908bc73ece..31bb3ab5aa 100644 --- a/contrib/kolibri-libc/source/stdio/fread.c +++ b/contrib/kolibri-libc/source/stdio/fread.c @@ -11,7 +11,7 @@ size_t fread(void *restrict ptr, size_t size, size_t nmemb, FILE *restrict strea break; } - ptr[i] = c; + *(char*)(ptr+i) = c; bytes_read++; } diff --git a/contrib/kolibri-libc/source/stdio/fwrite.c b/contrib/kolibri-libc/source/stdio/fwrite.c index 77ca5239bc..0324b2da43 100644 --- a/contrib/kolibri-libc/source/stdio/fwrite.c +++ b/contrib/kolibri-libc/source/stdio/fwrite.c @@ -5,8 +5,7 @@ size_t fwrite(const void *restrict ptr, size_t size, size_t nmemb, FILE *restric unsigned bytes_count = size * nmemb; for (size_t i = 0; i < bytes_count; i++) { - char c = ptr[i]; - + char c = *(char*)(ptr+i); if (fputc(c, stream) != c) { break; }