Years ago I released a program called Banshee Screamer Alarm and at the time it included the full source code, "for educational purposes only." You couldn't extend it to make your own version, but you could learn from it. It actually helped somebody fix a bug in wine.
If I release more software like this (open source, but copyrighted and non-free), are there any legal thorns that I should know about? Are there any suitable licenses for this purpose?