diff --git a/src/stdlib_io_npy_load.fypp b/src/stdlib_io_npy_load.fypp
index 01fce87a9..1d0468251 100644
--- a/src/stdlib_io_npy_load.fypp
+++ b/src/stdlib_io_npy_load.fypp
@@ -122,7 +122,10 @@ contains
         character(len=8) :: header
         character :: buf(4)
         logical :: fortran_order
-
+        
+        ! stat should be zero by default, if no error occured
+        stat = 0
+        
         read(io, iostat=stat) header
         if (stat /= 0) return