projects
/
yaz-moved-to-github.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
First go at returning start+offset
[yaz-moved-to-github.git]
/
src
/
marc_read_iso2709.c
diff --git
a/src/marc_read_iso2709.c
b/src/marc_read_iso2709.c
index
00fedbb
..
85412c3
100644
(file)
--- a/
src/marc_read_iso2709.c
+++ b/
src/marc_read_iso2709.c
@@
-1,5
+1,5
@@
/* This file is part of the YAZ toolkit.
/* This file is part of the YAZ toolkit.
- * Copyright (C) 1995-2012 Index Data
+ * Copyright (C) 1995-2013 Index Data
* See the file LICENSE for details.
*/
* See the file LICENSE for details.
*/
@@
-36,7
+36,11
@@
int yaz_marc_read_iso2709(yaz_marc_t mt, const char *buf, int bsize)
yaz_marc_reset(mt);
yaz_marc_reset(mt);
- record_length = atoi_n (buf, 5);
+ if (!atoi_n_check(buf, 5, &record_length))
+ {
+ yaz_marc_cprintf(mt, "Bad leader");
+ return -1;
+ }
if (record_length < 25)
{
yaz_marc_cprintf(mt, "Record length %d < 24", record_length);
if (record_length < 25)
{
yaz_marc_cprintf(mt, "Record length %d < 24", record_length);