Better diagnostics.
authorSebastian Hammer <quinn@indexdata.com>
Wed, 18 Oct 1995 16:12:30 +0000 (16:12 +0000)
committerSebastian Hammer <quinn@indexdata.com>
Wed, 18 Oct 1995 16:12:30 +0000 (16:12 +0000)
client/client.c
include/odr.h

index fd12e2d..f1f3c58 100644 (file)
@@ -4,7 +4,10 @@
  * Sebastian Hammer, Adam Dickmeiss
  *
  * $Log: client.c,v $
  * Sebastian Hammer, Adam Dickmeiss
  *
  * $Log: client.c,v $
- * Revision 1.22  1995-10-11 14:49:12  quinn
+ * Revision 1.23  1995-10-18 16:12:30  quinn
+ * Better diagnostics.
+ *
+ * Revision 1.22  1995/10/11  14:49:12  quinn
  * Smallish.
  *
  * Revision 1.21  1995/09/29  17:01:47  quinn
  * Smallish.
  *
  * Revision 1.21  1995/09/29  17:01:47  quinn
@@ -1002,6 +1005,7 @@ static int client(void)
                 if (!z_APDU(in, &apdu, 0))
                 {
                     odr_perror(in, "Decoding incoming APDU");
                 if (!z_APDU(in, &apdu, 0))
                 {
                     odr_perror(in, "Decoding incoming APDU");
+                   fprintf(stderr, "[Near %d]\n", odr_offset(in));
                     fprintf(stderr, "Packet dump:\n---------\n");
                     odr_dumpBER(stderr, netbuffer, res);
                     fprintf(stderr, "---------\n");
                     fprintf(stderr, "Packet dump:\n---------\n");
                     odr_dumpBER(stderr, netbuffer, res);
                     fprintf(stderr, "---------\n");
index 2c88189..8bfc445 100644 (file)
  * OF THIS SOFTWARE.
  *
  * $Log: odr.h,v $
  * OF THIS SOFTWARE.
  *
  * $Log: odr.h,v $
- * Revision 1.14  1995-09-29 17:12:04  quinn
+ * Revision 1.15  1995-10-18 16:12:36  quinn
+ * Better diagnostics.
+ *
+ * Revision 1.14  1995/09/29  17:12:04  quinn
  * Smallish
  *
  * Revision 1.13  1995/09/29  17:01:49  quinn
  * Smallish
  *
  * Revision 1.13  1995/09/29  17:01:49  quinn
@@ -347,6 +350,7 @@ void odr_release_mem(ODR_MEM p);
 ) \
 
 #define odr_tell(o) ((o)->ecb.pos)
 ) \
 
 #define odr_tell(o) ((o)->ecb.pos)
+#define odr_offset(o) ((o)->bp - (o)->buf)
 #define odr_ok(o) (!(o)->error)
 
 #define ODR_MAXNAME 256
 #define odr_ok(o) (!(o)->error)
 
 #define ODR_MAXNAME 256