From 6ad0a0bd70147cd784813e955a85f1c90de19b2d Mon Sep 17 00:00:00 2001 From: tgotic Date: Mon, 16 May 2011 20:04:56 +0200 Subject: [PATCH] =?UTF-8?q?ISBN-13=20check=20digit=20now=20correctly=20ide?= =?UTF-8?q?ntifies=20'0'.=20Thanks=20to=20K=C3=A9vin=20Sailly.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend/upcean.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/backend/upcean.c b/backend/upcean.c index f9a6c989..cf60733f 100644 --- a/backend/upcean.c +++ b/backend/upcean.c @@ -376,8 +376,8 @@ char isbn13_check(unsigned char source[]) /* For ISBN(13) only */ if(weight == 1) weight = 3; else weight = 1; } - check = sum % 10; - check = 10 - check; + check = (10 - (sum % 10)) % 10; + return itoc(check); }