Instread of the 'skip' variable, just test if rdev is NULL or not.
Attach a file by drag & drop or click to upload