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
Better checking for invalid OID's in p_query_rpn.
[yaz-moved-to-github.git]
/
odr
/
dumpber.c
diff --git
a/odr/dumpber.c
b/odr/dumpber.c
index
7acc3aa
..
1af624a
100644
(file)
--- a/
odr/dumpber.c
+++ b/
odr/dumpber.c
@@
-4,7
+4,13
@@
* Sebastian Hammer, Adam Dickmeiss
*
* $Log: dumpber.c,v $
* Sebastian Hammer, Adam Dickmeiss
*
* $Log: dumpber.c,v $
- * Revision 1.7 1996-03-08 14:38:41 quinn
+ * Revision 1.9 1998-01-14 09:53:26 quinn
+ * Added a bit more info to dump.
+ *
+ * Revision 1.8 1997/05/14 06:53:57 adam
+ * C++ support.
+ *
+ * Revision 1.7 1996/03/08 14:38:41 quinn
* Fixed output.
*
* Revision 1.6 1996/01/19 15:41:34 quinn
* Fixed output.
*
* Revision 1.6 1996/01/19 15:41:34 quinn
@@
-33,14
+39,14
@@
static int do_dumpBER(FILE *f, char *buf, int len, int level, int offset)
{
static int do_dumpBER(FILE *f, char *buf, int len, int level, int offset)
{
- int res, ll, class, tag, cons;
- char *b = buf;
+ int res, ll, zclass, tag, cons, lenlen, taglen;
+ char *b = buf, *bp = buf;
if (!len)
return 0;
if (!buf[0] && !buf[1])
return 0;
if (!len)
return 0;
if (!buf[0] && !buf[1])
return 0;
- if ((res = ber_dectag((unsigned char*)b, &class, &tag, &cons)) <= 0)
+ if ((res = ber_dectag((unsigned char*)b, &zclass, &tag, &cons)) <= 0)
return 0;
if (res > len)
{
return 0;
if (res > len)
{
@@
-48,7
+54,7
@@
static int do_dumpBER(FILE *f, char *buf, int len, int level, int offset)
return 0;
}
fprintf(f, "%5d: %*s", offset, level * 4, "");
return 0;
}
fprintf(f, "%5d: %*s", offset, level * 4, "");
- if (class == ODR_UNIVERSAL)
+ if (zclass == ODR_UNIVERSAL)
{
static char *nl[] =
{
{
static char *nl[] =
{
@@
-65,12
+71,14
@@
static int do_dumpBER(FILE *f, char *buf, int len, int level, int offset)
else
fprintf(f, "[UNIV %d]", tag);
}
else
fprintf(f, "[UNIV %d]", tag);
}
- else if (class == ODR_CONTEXT)
+ else if (zclass == ODR_CONTEXT)
fprintf(f, "[%d]", tag);
else
fprintf(f, "[%d]", tag);
else
- fprintf(f, "[%d:%d]", class, tag);
+ fprintf(f, "[%d:%d]", zclass, tag);
b += res;
b += res;
+ taglen = res;
len -= res;
len -= res;
+ bp = b;
if ((res = ber_declen((unsigned char*)b, &ll)) <= 0)
{
fprintf(f, "bad length\n");
if ((res = ber_declen((unsigned char*)b, &ll)) <= 0)
{
fprintf(f, "bad length\n");
@@
-81,12
+89,14
@@
static int do_dumpBER(FILE *f, char *buf, int len, int level, int offset)
fprintf(f, "Unexpected end of buffer\n");
return 0;
}
fprintf(f, "Unexpected end of buffer\n");
return 0;
}
+ lenlen = res;
b += res;
len -= res;
if (ll >= 0)
b += res;
len -= res;
if (ll >= 0)
- fprintf(f, " len=%d\n", ll);
+ fprintf(f, " len=%d", ll);
else
else
- fprintf(f, " len=?\n");
+ fprintf(f, " len=?");
+ fprintf(f, " tl=%d, ll=%d\n", taglen, lenlen);
if (!cons)
{
if (ll < 0)
if (!cons)
{
if (ll < 0)