[PATCH] am: fix condition check on fseek

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



if fseek() is success, return value is 0

Signed-off-by: Ruffalo Lavoisier <RuffaloLavoisier@xxxxxxxxx>
---
 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





[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux