git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] am: fix condition check on fseek
@ 2024-09-21 15:08 Ruffalo Lavoisier
  2024-09-21 19:52 ` Kristoffer Haugsbakk
  0 siblings, 1 reply; 3+ messages in thread
From: Ruffalo Lavoisier @ 2024-09-21 15:08 UTC (permalink / raw)
  To: git; +Cc: Ruffalo Lavoisier, Stephan Beyer, Junio C Hamano, Jeff King

if fseek() is success, return value is 0

Signed-off-by: Ruffalo Lavoisier <RuffaloLavoisier@gmail.com>
---
 builtin/am.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/builtin/am.c b/builtin/am.c
index d8875ad402..a7727fd4ea 100644
--- a/builtin/am.c
+++ b/builtin/am.c
@@ -589,7 +589,7 @@ static int is_mail(FILE *fp)
 	regex_t regex;
 	int ret = 1;
 
-	if (fseek(fp, 0L, SEEK_SET))
+	if (!fseek(fp, 0L, SEEK_SET))
 		die_errno(_("fseek failed"));
 
 	if (regcomp(&regex, header_regex, REG_NOSUB | REG_EXTENDED))
-- 
2.46.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2024-09-23 16:43 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-09-21 15:08 [PATCH] am: fix condition check on fseek Ruffalo Lavoisier
2024-09-21 19:52 ` Kristoffer Haugsbakk
2024-09-23 16:43   ` Junio C Hamano

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).