projects
/
postgresql.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
d9c4442
)
Fix calculation of ISMN check digit.
author
Heikki Linnakangas
<
[email protected]
>
Mon, 13 Jan 2014 13:42:35 +0000
(15:42 +0200)
committer
Heikki Linnakangas
<
[email protected]
>
Mon, 13 Jan 2014 13:44:12 +0000
(15:44 +0200)
This has always been broken, so back-patch to all supported versions.
Fabien COELHO
contrib/isn/isn.c
patch
|
blob
|
blame
|
history
diff --git
a/contrib/isn/isn.c
b/contrib/isn/isn.c
index dac760b1114846fbdc513f6effe1bf0792ccf839..6527b4b3af63ef7e18e38443f24012328cfeae11 100644
(file)
--- a/
contrib/isn/isn.c
+++ b/
contrib/isn/isn.c
@@
-822,7
+822,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);