加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
backport-head-off_t-not-uintmax_t-for-file-offset.patch 868 Bytes
一键复制 编辑 原始数据 按行查看 历史
胡宇彪 提交于 2024-09-11 16:13 . sync patches from community
From 0f9e2719e0dd2366f0381daa832f9415f3162af2 Mon Sep 17 00:00:00 2001
From: Paul Eggert <eggert@cs.ucla.edu>
Date: Sat, 10 Aug 2024 18:55:09 -0700
Subject: [PATCH] head: off_t not uintmax_t for file offset
* src/head.c (elide_tail_lines_pipe):
Use off_t, not uintmax_t, for a local var that is
a file offset.
---
src/head.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/head.c b/src/head.c
index 2795ae486..a9155c24c 100644
--- a/src/head.c
+++ b/src/head.c
@@ -504,7 +504,7 @@ elide_tail_lines_pipe (char const *filename, int fd, uintmax_t n_elide,
size_t nlines;
struct linebuffer *next;
};
- uintmax_t desired_pos = current_pos;
+ off_t desired_pos = current_pos;
typedef struct linebuffer LBUFFER;
LBUFFER *first, *last, *tmp;
size_t total_lines = 0; /* Total number of newlines in all buffers. */
--
2.43.0
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化