[PATCH] am: fix condition check on fseek
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(®ex, header_regex, REG_NOSUB | REG_EXTENDED))
--
2.46.1