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
Moved .h files to include directory
[yaz-moved-to-github.git]
/
odr
/
ber_null.c
diff --git
a/odr/ber_null.c
b/odr/ber_null.c
index
8543f7f
..
2fbaf6d
100644
(file)
--- a/
odr/ber_null.c
+++ b/
odr/ber_null.c
@@
-4,7
+4,10
@@
* Sebastian Hammer, Adam Dickmeiss
*
* $Log: ber_null.c,v $
* Sebastian Hammer, Adam Dickmeiss
*
* $Log: ber_null.c,v $
- * Revision 1.2 1995-02-09 15:51:46 quinn
+ * Revision 1.3 1995-03-08 12:12:09 quinn
+ * Added better error checking.
+ *
+ * Revision 1.2 1995/02/09 15:51:46 quinn
* Works better now.
*
* Revision 1.1 1995/02/02 16:21:52 quinn
* Works better now.
*
* Revision 1.1 1995/02/02 16:21:52 quinn
@@
-22,6
+25,11
@@
int ber_null(ODR o, int *val)
switch (o->direction)
{
case ODR_ENCODE:
switch (o->direction)
{
case ODR_ENCODE:
+ if (!o->left)
+ {
+ o->error = OSPACE;
+ return 0;
+ }
*(o->bp++) = 0X00;
o->left--;
#ifdef ODR_DEBUG
*(o->bp++) = 0X00;
o->left--;
#ifdef ODR_DEBUG
@@
-30,13
+38,16
@@
int ber_null(ODR o, int *val)
return 1;
case ODR_DECODE:
if (*(o->bp++) != 0X00)
return 1;
case ODR_DECODE:
if (*(o->bp++) != 0X00)
+ {
+ o->error = OPROTO;
return 0;
return 0;
+ }
o->left--;
#ifdef ODR_DEBUG
fprintf(stderr, "[NULL]\n");
#endif
return 1;
case ODR_PRINT: return 1;
o->left--;
#ifdef ODR_DEBUG
fprintf(stderr, "[NULL]\n");
#endif
return 1;
case ODR_PRINT: return 1;
- default: return 0;
+ default: o->error = OOTHER; return 0;
}
}
}
}