diff options
Diffstat (limited to 'coreutils')
-rw-r--r-- | coreutils/cut.c | 6 | ||||
-rw-r--r-- | coreutils/uudecode.c | 10 |
2 files changed, 4 insertions, 12 deletions
diff --git a/coreutils/cut.c b/coreutils/cut.c index abe05726b..3ed264870 100644 --- a/coreutils/cut.c +++ b/coreutils/cut.c | |||
@@ -344,10 +344,8 @@ extern int cut_main(int argc, char **argv) | |||
344 | int i; | 344 | int i; |
345 | FILE *file; | 345 | FILE *file; |
346 | for (i = optind; i < argc; i++) { | 346 | for (i = optind; i < argc; i++) { |
347 | file = fopen(argv[i], "r"); | 347 | file = wfopen(argv[i], "r"); |
348 | if (file == NULL) { | 348 | if(file) { |
349 | perror_msg("%s", argv[i]); | ||
350 | } else { | ||
351 | cut_file(file); | 349 | cut_file(file); |
352 | fclose(file); | 350 | fclose(file); |
353 | } | 351 | } |
diff --git a/coreutils/uudecode.c b/coreutils/uudecode.c index 6ac9f1bf3..a4059ddfe 100644 --- a/coreutils/uudecode.c +++ b/coreutils/uudecode.c | |||
@@ -201,9 +201,8 @@ static int decode (const char *inname, | |||
201 | const char *forced_outname) | 201 | const char *forced_outname) |
202 | { | 202 | { |
203 | struct passwd *pw; | 203 | struct passwd *pw; |
204 | register int n; | ||
205 | register char *p; | 204 | register char *p; |
206 | int mode, n1; | 205 | int mode; |
207 | char buf[2 * BUFSIZ]; | 206 | char buf[2 * BUFSIZ]; |
208 | char *outname; | 207 | char *outname; |
209 | int do_base64 = 0; | 208 | int do_base64 = 0; |
@@ -249,12 +248,7 @@ static int decode (const char *inname, | |||
249 | error_msg("%s: No user `%s'", inname, buf + 1); | 248 | error_msg("%s: No user `%s'", inname, buf + 1); |
250 | return FALSE; | 249 | return FALSE; |
251 | } | 250 | } |
252 | n = strlen (pw->pw_dir); | 251 | outname = concat_path_file(pw->pw_dir, p); |
253 | n1 = strlen (p); | ||
254 | outname = (char *) xmalloc ((size_t) (n + n1 + 2)); | ||
255 | memcpy (outname + n + 1, p, (size_t) (n1 + 1)); | ||
256 | memcpy (outname, pw->pw_dir, (size_t) n); | ||
257 | outname[n] = '/'; | ||
258 | dofre = TRUE; | 252 | dofre = TRUE; |
259 | } | 253 | } |
260 | } | 254 | } |