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
Merge branch 'master' of ssh://git.indexdata.com/home/git/pub/yaz
[yaz-moved-to-github.git]
/
src
/
marcdisp.c
diff --git
a/src/marcdisp.c
b/src/marcdisp.c
index
2f5f0d5
..
a5084ce
100644
(file)
--- a/
src/marcdisp.c
+++ b/
src/marcdisp.c
@@
-467,7
+467,7
@@
int yaz_marc_write_line(yaz_marc_t mt, WRBUF wr)
the code is a single character .. However we've
seen multibyte codes, so see how big it really is */
size_t using_code_len =
the code is a single character .. However we've
seen multibyte codes, so see how big it really is */
size_t using_code_len =
- (identifier_length != 2) ? identifier_length - 1
+ (identifier_length > 2) ? identifier_length - 1
:
cdata_one_character(mt, s->code_data);
:
cdata_one_character(mt, s->code_data);
@@
-616,7
+616,7
@@
static int yaz_marc_write_marcxml_ns1(yaz_marc_t mt, WRBUF wr,
the code is a single character .. However we've
seen multibyte codes, so see how big it really is */
size_t using_code_len =
the code is a single character .. However we've
seen multibyte codes, so see how big it really is */
size_t using_code_len =
- (identifier_length != 2) ? identifier_length - 1
+ (identifier_length > 2) ? identifier_length - 1
:
cdata_one_character(mt, s->code_data);
:
cdata_one_character(mt, s->code_data);
@@
-786,7
+786,7
@@
int yaz_marc_write_xml(yaz_marc_t mt, xmlNode **root_ptr,
the code is a single character .. However we've
seen multibyte codes, so see how big it really is */
size_t using_code_len =
the code is a single character .. However we've
seen multibyte codes, so see how big it really is */
size_t using_code_len =
- (identifier_length != 2) ? identifier_length - 1
+ (identifier_length > 2) ? identifier_length - 1
:
cdata_one_character(mt, s->code_data);
:
cdata_one_character(mt, s->code_data);
@@
-1051,7
+1051,7
@@
static int marc_exec_leader(const char *leader_spec, char *leader, size_t size)
no = sscanf(cp, "%d=%20[^,]%n", &pos, val, &no_read);
if (no < 2 || no_read < 3)
return -1;
no = sscanf(cp, "%d=%20[^,]%n", &pos, val, &no_read);
if (no < 2 || no_read < 3)
return -1;
- if (pos < 0 || pos >= size)
+ if (pos < 0 || (size_t) pos >= size)
return -1;
if (*val == '\'')
return -1;
if (*val == '\'')