Thread (34 messages) flat view 34 messages, 3 authors, 2024-09-17
STALE728d

Revision v1 of 2 in this series.

Revisions (2)
  1. v1 current
  2. v2 [diff vs current]

[PATCH v1 09/10] cat-file: batch_write: use size_t for length

From: Eric Wong <hidden>
Date: 2024-07-15 00:36:28
Subsystem: the rest · Maintainer: Linus Torvalds

fwrite(3) and write(2), and all of our wrappers for them use
size_t while object size is `unsigned long', so there's no
excuse to use a potentially smaller representation.

Signed-off-by: Eric Wong <redacted>
---
 builtin/cat-file.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/builtin/cat-file.c b/builtin/cat-file.c
index c4c28236db..efc0df760c 100644
--- a/builtin/cat-file.c
+++ b/builtin/cat-file.c
@@ -370,7 +370,7 @@ static void expand_format(struct strbuf *sb, const char *start,
 	}
 }
 
-static void batch_write(struct batch_options *opt, const void *data, int len)
+static void batch_write(struct batch_options *opt, const void *data, size_t len)
 {
 	if (opt->buffer_output) {
 		if (fwrite(data, 1, len, stdout) != len)
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help