aboutsummaryrefslogtreecommitdiff
path: root/loginutils/deluser.c
diff options
context:
space:
mode:
Diffstat (limited to 'loginutils/deluser.c')
-rw-r--r--loginutils/deluser.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/loginutils/deluser.c b/loginutils/deluser.c
index bbbd77dbd..795dae49f 100644
--- a/loginutils/deluser.c
+++ b/loginutils/deluser.c
@@ -54,7 +54,7 @@ static void del_line_matching(const char *login, const char *filename)
54 struct stat statbuf; 54 struct stat statbuf;
55 55
56 56
57 if ((passwd = bb_wfopen(filename, "r"))) { 57 if ((passwd = fopen_or_warn(filename, "r"))) {
58 // Remove pointless const. 58 // Remove pointless const.
59 xstat((char *)filename, &statbuf); 59 xstat((char *)filename, &statbuf);
60 buffer = (char *) xmalloc(statbuf.st_size * sizeof(char)); 60 buffer = (char *) xmalloc(statbuf.st_size * sizeof(char));
@@ -64,7 +64,7 @@ static void del_line_matching(const char *login, const char *filename)
64 b = boundary(buffer, login); 64 b = boundary(buffer, login);
65 if (b.stop != 0) { 65 if (b.stop != 0) {
66 /* write the file w/o the user */ 66 /* write the file w/o the user */
67 if ((passwd = bb_wfopen(filename, "w"))) { 67 if ((passwd = fopen_or_warn(filename, "w"))) {
68 fwrite(buffer, (b.start - 1), sizeof(char), passwd); 68 fwrite(buffer, (b.start - 1), sizeof(char), passwd);
69 fwrite(&buffer[b.stop], (statbuf.st_size - b.stop), sizeof(char), passwd); 69 fwrite(&buffer[b.stop], (statbuf.st_size - b.stop), sizeof(char), passwd);
70 fclose(passwd); 70 fclose(passwd);