Improved code according c language linux core guidelines.