summaryrefslogtreecommitdiff
path: root/userland/libc/stdio/open_memstream.c
diff options
context:
space:
mode:
authorAnton Kling <anton@kling.gg>2023-11-23 00:52:35 +0100
committerAnton Kling <anton@kling.gg>2023-11-23 00:52:35 +0100
commit81819f711e6d1f9216f688da8ecbbc682d106d9c (patch)
tree0f0df7c43cc5bc956c2c067e55766bfa90823a7f /userland/libc/stdio/open_memstream.c
parentec91e81a4fcfd7ee6bc4150f06d8740e82f808da (diff)
LibC: Reduce warnings in code
Diffstat (limited to 'userland/libc/stdio/open_memstream.c')
-rw-r--r--userland/libc/stdio/open_memstream.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/userland/libc/stdio/open_memstream.c b/userland/libc/stdio/open_memstream.c
index 8f359b9..0d3df86 100644
--- a/userland/libc/stdio/open_memstream.c
+++ b/userland/libc/stdio/open_memstream.c
@@ -1,4 +1,5 @@
#include <assert.h>
+#include <math.h>
#include <stddef.h>
#include <stdio.h>
#include <stdlib.h>
@@ -34,7 +35,7 @@ size_t memstream_write(FILE *fp, const unsigned char *buf, size_t n) {
memcpy(c->buffer + fp->offset_in_file, buf, n);
fp->offset_in_file += n;
- if (fp->offset_in_file > c->buffer_usage)
+ if (fp->offset_in_file > (long)c->buffer_usage)
c->buffer_usage = fp->offset_in_file;
return n;
}