An error analysis of finite-difference approximations for the boundary-layer equations