To be honest, small bugs in code samples don't bother me that much; misspelled variables or occasionally omitted punctuation in the samples aren't that big a deal. I don't like things that are fundamentally wrong, like <tt>void main()</tt>, however. The former I can excuse by blaming whoever was responsible for editing or typesetting (or DTPing or whatever it's called these days). The latter, however, undermines the credibility of the person writing the example. It's like the difference between a typo and a misspelling -- they may look similar, but only one is a result of a lack of knowledge.
It's higher level features of the text that are more important. Is it accurate, clear, and concise? Does it teach things properly. A common example in many introductory books is to have someone implement a linked list. Many books teach this in an abysmal manner. I've come across books that suggest an <tt>operator[]</tt> overload for a linked list -- that is, indexed access to a container that has linear-time access, and other absurdities. Things like that are far more telling than bugs in the code.