Just picking some nits, but "But in this case this code is copyrighted" is wrong. In _all_ cases, code is copyrighted, even open source code. It's just that with F/OSS, someone has given you a license to use something they've created.
Actually no, you can put code in the public domain, thereby explicitly waiving your copyright. I believe, for example, that all code written by the US government is in the public domain.
I'm not a lawyer, but in some places, isn't it hard or next to impossible to get your work into the public domain? You're 100% right about government works, but I was under the impression that the WTFPL was the closest thing you could really get to putting something of your own into the public domain...
I could also be totally wrong. Then again, anyone who does this isn't going to face the problem that the OP did, and it doesn't really invalidate my earlier statement either. Only part of it.
I'm not a lawyer, but in some places, isn't it hard or next to impossible to get your work into the public domain?
I'm also not a lawyer, but I've asked this question of some law professors, and the consensus appears to be that at least in common law states, while there is usually no de jure mechanism for placing work into the public domain, if such a case ever went to trial you can be 99% certain that the judge would wave a magic common law wand to fix that.
That said, wikipedia's "I place this in the public domain, or if that isn't possible, I grant anyone the right to use this work for any purpose, without any conditions" is probably the safest approach.
In EU, there are essentialy two kinds of protection awarded by copyright law, something around the lines of author rights(like right to attribution and so on) and usage rights. And it is not possible for author to vaive his author rights, so there is no strict equivalent of public domain, but in practice this formal difference probably does not matter.
Other than that, carry on.