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
odr_create_Odr_oct: null terminate the buffer
[yaz-moved-to-github.git]
/
src
/
ber_bool.c
diff --git
a/src/ber_bool.c
b/src/ber_bool.c
index
8d74df9
..
de1ba3a
100644
(file)
--- a/
src/ber_bool.c
+++ b/
src/ber_bool.c
@@
-1,11
+1,9
@@
-/*
- * Copyright (C) 1995-2005, Index Data ApS
+/* This file is part of the YAZ toolkit.
+ * Copyright (C) 1995-2013 Index Data
* See the file LICENSE for details.
* See the file LICENSE for details.
- *
- * $Id: ber_bool.c,v 1.4 2005-06-25 15:46:03 adam Exp $
*/
*/
-/**
+/**
* \file ber_bool.c
* \brief Implements BER BOOLEAN encoding and decoding
*
* \file ber_bool.c
* \brief Implements BER BOOLEAN encoding and decoding
*
@@
-31,27
+29,21
@@
int ber_boolean(ODR o, int *val)
return 0;
if (odr_putc(o, *val) < 0)
return 0;
return 0;
if (odr_putc(o, *val) < 0)
return 0;
-#ifdef ODR_DEBUG
- fprintf(stderr, "[val=%d]\n", *val);
-#endif
return 1;
case ODR_DECODE:
return 1;
case ODR_DECODE:
- if ((res = ber_declen(o->bp, &len, odr_max(o))) < 0)
+ if ((res = ber_declen(o->op->bp, &len, odr_max(o))) < 0)
{
odr_seterror(o, OPROTO, 9);
return 0;
}
{
odr_seterror(o, OPROTO, 9);
return 0;
}
- o->bp+= res;
+ o->op->bp+= res;
if (len != 1 || odr_max(o) < len)
{
odr_seterror(o, OPROTO, 10);
return 0;
}
if (len != 1 || odr_max(o) < len)
{
odr_seterror(o, OPROTO, 10);
return 0;
}
- *val = *o->bp;
- o->bp++;
-#ifdef ODR_DEBUG
- fprintf(stderr, "[val=%d]\n", *val);
-#endif
+ *val = *o->op->bp;
+ o->op->bp++;
return 1;
case ODR_PRINT:
return 1;
return 1;
case ODR_PRINT:
return 1;
@@
-61,6
+53,7
@@
int ber_boolean(ODR o, int *val)
/*
* Local variables:
* c-basic-offset: 4
/*
* Local variables:
* c-basic-offset: 4
+ * c-file-style: "Stroustrup"
* indent-tabs-mode: nil
* End:
* vim: shiftwidth=4 tabstop=8 expandtab
* indent-tabs-mode: nil
* End:
* vim: shiftwidth=4 tabstop=8 expandtab