From 34506361697643277042fc8d7294bc17a27d4e28 Mon Sep 17 00:00:00 2001 From: Eric Andersen Date: Thu, 2 Aug 2001 05:02:46 +0000 Subject: Latest patch from vodz. Adds a check for divide by zero in the posix math suport, cleaner math syntax error checking, moves redundant signal string tables (from kill and ash) into libbb and provides a few cleanups elsewhere. --- coreutils/cut.c | 6 ++---- coreutils/uudecode.c | 10 ++-------- 2 files changed, 4 insertions(+), 12 deletions(-) (limited to 'coreutils') 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) int i; FILE *file; for (i = optind; i < argc; i++) { - file = fopen(argv[i], "r"); - if (file == NULL) { - perror_msg("%s", argv[i]); - } else { + file = wfopen(argv[i], "r"); + if(file) { cut_file(file); fclose(file); } 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, const char *forced_outname) { struct passwd *pw; - register int n; register char *p; - int mode, n1; + int mode; char buf[2 * BUFSIZ]; char *outname; int do_base64 = 0; @@ -249,12 +248,7 @@ static int decode (const char *inname, error_msg("%s: No user `%s'", inname, buf + 1); return FALSE; } - n = strlen (pw->pw_dir); - n1 = strlen (p); - outname = (char *) xmalloc ((size_t) (n + n1 + 2)); - memcpy (outname + n + 1, p, (size_t) (n1 + 1)); - memcpy (outname, pw->pw_dir, (size_t) n); - outname[n] = '/'; + outname = concat_path_file(pw->pw_dir, p); dofre = TRUE; } } -- cgit v1.2.3