The current printAttribute() function has no default case for the switch statement, so if an unhandled attribute ID is passed to it, nothing gets printed out. I recommend adding a default case, such as the following:
printAttr8(label, "UNKNOWN ATTRIBUTE", attributeId, valueLen, value);
After I added this to my code I discovered that I had forgotten to include a case block for an attribute I had added.
Also, I noticed that the getPrintAttrHeader() function does nothing with the attributeId parameter that is passed to it. I modified the function so it includes the following:
"%s id: %s (%05d) len: %05d value: ", sourceLabel, attrLabel, attributeId, valueLen);
The benefit of this is that if (assuming the default case has been added to printAttribute()) an unknown attribute is printed, the ID code gets printed out to help you figure out what the attribute is.