optimization in writeLongString() and fix size for nprintf()
writeLongString(): handle unability to write as an error
added factor.c sample from http://nopedotc.com/ homepage
Fix issue #9 by using nprintf() rather than sprintf()
Merge pull request #11 from MagicalTux/master

optimization in writeLongString() and fix size for nprintf()