Ensuring the right note is played everywhere on the fretboard by adjusting string length by moving the saddles slightly closer or further from the fretboard.  Tuning open strings does not ensure you’ll play the right notes when you fret a string.  Each string length must be individually adjusted, usually by ensuring notes one octave higher at the 12th fret than the open string, but it’s important to check the frets at each end of the fretboard also.