Safely & portably read a value into a predefined integral type of varying size like mode_t
An alternative would be to store the value, then test whether any truncation occured:

m = u;
if (m != u) goto error_too_big;


I think some of the single-character variables (e, u, c, etc.) could be given better names.  The next person to modify the code (which could be Future You) will pick it up more quickly if it has meaningful variable names.