Skip to content
Snippets Groups Projects
Commit 866a1f09 authored by Heikki Linnakangas's avatar Heikki Linnakangas
Browse files

Fix calculation of ISMN check digit.

This has always been broken, so back-patch to all supported versions.

Fabien COELHO
parent 04038148
No related branches found
No related tags found
No related merge requests found
...@@ -827,7 +827,7 @@ string2ean(const char *str, bool errorOK, ean13 *result, ...@@ -827,7 +827,7 @@ string2ean(const char *str, bool errorOK, ean13 *result,
case ISMN: case ISMN:
strncpy(buf, "9790", 4); /* this isn't for sure yet, for now strncpy(buf, "9790", 4); /* this isn't for sure yet, for now
* ISMN it's only 9790 */ * ISMN it's only 9790 */
valid = (valid && ((rcheck = checkdig(buf + 3, 10)) == check || magic)); valid = (valid && ((rcheck = checkdig(buf, 13)) == check || magic));
break; break;
case ISBN: case ISBN:
strncpy(buf, "978", 3); strncpy(buf, "978", 3);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment