Update loader.c

Moved from pull request on master to 1.3.0
Merge pull request #1069 from thecodeassassin/patch-3

Update loader.c