- s = strtok(s, ":"); if (!s) goto tidy_0; pw->pw_name = xstrdup(s);
- s = strtok(0, ":"); if (!s) goto tidy_1; pw->pw_passwd = xstrdup(s);
- s = strtok(0, ":"); if (!s) goto tidy_2; pw->pw_uid = (uid_t)atol(s);
- s = strtok(0, ":"); if (!s) goto tidy_2; pw->pw_gid = (gid_t)atol(s);
- s = strtok(0, ":"); if (!s) goto tidy_2; pw->pw_gecos = xstrdup(s);
- s = strtok(0, ":"); if (!s) goto tidy_3; pw->pw_dir = xstrdup(s);
- s = strtok(0, ":"); if (!s) goto tidy_4; pw->pw_shell = xstrdup(s);
- return (pw);
-
- /* --- Error handling --- */
-
-tidy_4:
- free(pw->pw_dir);
-tidy_3:
- free(pw->pw_gecos);
-tidy_2:
- free(pw->pw_passwd);
-tidy_1:
- free(pw->pw_name);
-tidy_0:
- free(pw);