postgres.git / summary / log / commit / refs
commit 5143dfd5713299048c556d69f93bf17108693db9
Author: Heikki Linnakangas <heikki.linnakangas@iki.fi>
Date: Mon Jan 13 13:42:35 2014 +0000
First released in: 9.4.0, 8.4.20, 9.0.16, 9.1.12, 9.2.7, 9.3.3
Fix calculation of ISMN check digit.
This has always been broken, so back-patch to all supported versions.
Fabien COELHO
contrib/isn/isn.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/contrib/isn/isn.c b/contrib/isn/isn.c
index b698cb00ff5..40942750feb 100644
--- a/contrib/isn/isn.c
+++ b/contrib/isn/isn.c
@@ -827,7 +827,7 @@ string2ean(const char *str, bool errorOK, ean13 *result,
case ISMN:
strncpy(buf, "9790", 4); /* this isn't for sure yet, for now
* ISMN it's only 9790 */
- valid = (valid && ((rcheck = checkdig(buf + 3, 10)) == check || magic));
+ valid = (valid && ((rcheck = checkdig(buf, 13)) == check || magic));
break;
case ISBN:
strncpy(buf, "978", 3);
[parent: 3f721588aec4]