Revision (30.04.14) of openiapp.c

The revision (30.04.14) include:
-Security changes for avoiding 'Segmentation Fault' of Buffer Overflows/Underflows.
-Added few lines for smalls aspects changes and others

;) goodbye!