aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDimitri Sokolyuk <demon@dim13.org>2015-10-06 19:36:07 +0200
committerDimitri Sokolyuk <demon@dim13.org>2015-10-06 19:36:07 +0200
commit8c8da68b8dd2e616ab5b0a2949c938c3eb9cd1ef (patch)
tree05d4af8d09739ab3c9d61e96aec298d5b681001f
parent54a338c2597a814c8758482ce3c4f2f4b7213d78 (diff)
Don't step into primitive types
-rw-r--r--ber/dump.go5
1 files changed, 3 insertions, 2 deletions
diff --git a/ber/dump.go b/ber/dump.go
index 8c08761..3d27b4e 100644
--- a/ber/dump.go
+++ b/ber/dump.go
@@ -15,7 +15,8 @@ func (s *state) dump(indent int) (ret string) {
for s.Len() > 0 {
h := s.unmarshalClass()
ret += fmt.Sprintf("%3d: %*s%v: ", s.Len(), 2*indent, "", h)
- if h.Class == classUniversal && h.Kind == kindPrimitive {
+ switch h.Kind {
+ case kindPrimitive:
switch h.Tag {
case tagInteger, tagEnumerated:
ret += fmt.Sprintln(s.unmarshalInt())
@@ -30,7 +31,7 @@ func (s *state) dump(indent int) (ret string) {
default:
ret += fmt.Sprintln(s.next())
}
- } else {
+ case kindConstructed:
ret += fmt.Sprintln("→")
ret += s.subState().dump(indent + 1)
}