Removed trailing \n from error_msg{,_and_die} messages.
authorMatt Kraai <kraai@debian.org>
Wed, 31 Jan 2001 19:00:21 +0000 (19:00 -0000)
committerMatt Kraai <kraai@debian.org>
Wed, 31 Jan 2001 19:00:21 +0000 (19:00 -0000)
106 files changed:
applets/busybox.c
ar.c
archival/ar.c
archival/dpkg_deb.c
archival/gunzip.c
archival/gzip.c
archival/tar.c
busybox.c
chmod_chown_chgrp.c
cmdedit.c
console-tools/deallocvt.c
console-tools/dumpkmap.c
console-tools/loadacm.c
console-tools/loadfont.c
console-tools/loadkmap.c
console-tools/setkeycodes.c
coreutils/cut.c
coreutils/dd.c
coreutils/df.c
coreutils/expr.c
coreutils/id.c
coreutils/logname.c
coreutils/md5sum.c
coreutils/mkdir.c
coreutils/test.c
coreutils/tr.c
coreutils/uudecode.c
coreutils/uuencode.c
coreutils/whoami.c
cp_mv.c
cut.c
dc.c
dd.c
deallocvt.c
df.c
dpkg_deb.c
dumpkmap.c
editors/sed.c
expr.c
fbset.c
fsck_minix.c
getopt.c
gunzip.c
gzip.c
hostname.c
id.c
insmod.c
kill.c
lash.c
loadacm.c
loadfont.c
loadkmap.c
logger.c
logname.c
md5sum.c
messages.c
miscutils/dc.c
miscutils/mt.c
mkdir.c
mkfs_minix.c
mkswap.c
modutils/insmod.c
mount.c
mt.c
nc.c
networking/hostname.c
networking/nc.c
networking/ping.c
networking/telnet.c
networking/wget.c
nfsmount.c
ping.c
procps/kill.c
procps/ps.c
ps.c
rdate.c
rpmunpack.c
sed.c
setkeycodes.c
sh.c
shell/cmdedit.c
shell/lash.c
swaponoff.c
sysklogd/logger.c
sysklogd/syslogd.c
syslogd.c
tar.c
telnet.c
test.c
tr.c
umount.c
util-linux/fbset.c
util-linux/fsck_minix.c
util-linux/getopt.c
util-linux/mkfs_minix.c
util-linux/mkswap.c
util-linux/mount.c
util-linux/nfsmount.c
util-linux/rdate.c
util-linux/swaponoff.c
util-linux/umount.c
utility.c
uudecode.c
uuencode.c
wget.c
whoami.c

index e56d2a4ed805e9b2112e559ddcfd9cf268d9608b..f10467a3bea29d28d4a443d64bf1c67a65204564 100644 (file)
@@ -113,7 +113,7 @@ int main(int argc, char **argv)
                exit((*(applet->main)) (argc, argv));
        }
 
-       error_msg_and_die("applet not found\n");
+       error_msg_and_die("applet not found");
 }
 
 
diff --git a/ar.c b/ar.c
index 550b2a1c42a50890ab9fcd3b2aa2e4e278400afd..5aba30de0fe5bffa017afaa13ab1d09bb12502e6 100644 (file)
--- a/ar.c
+++ b/ar.c
@@ -65,9 +65,9 @@ extern ar_headers_t get_headers(int srcFd)
        
        /* check ar magic */
        if (full_read(srcFd, ar_magic, 8) != 8)
-               error_msg_and_die("cannot read magic\n");
+               error_msg_and_die("cannot read magic");
        if (strncmp(ar_magic,"!<arch>",7) != 0)
-               error_msg_and_die("invalid magic\n");
+               error_msg_and_die("invalid magic");
 
        while (full_read(srcFd, (char *) &raw_ar_header, 60)==60) {
                /* check the end of header markers are valid */
@@ -168,7 +168,7 @@ extern int ar_main(int argc, char **argv)
                usage(ar_usage);
        
        if ( (srcFd = open(argv[optind], O_RDONLY)) < 0)
-               error_msg_and_die("Cannot read %s\n", argv[optind]);
+               error_msg_and_die("Cannot read %s", argv[optind]);
 
        optind++;       
        head = get_headers(srcFd);
index 550b2a1c42a50890ab9fcd3b2aa2e4e278400afd..5aba30de0fe5bffa017afaa13ab1d09bb12502e6 100644 (file)
@@ -65,9 +65,9 @@ extern ar_headers_t get_headers(int srcFd)
        
        /* check ar magic */
        if (full_read(srcFd, ar_magic, 8) != 8)
-               error_msg_and_die("cannot read magic\n");
+               error_msg_and_die("cannot read magic");
        if (strncmp(ar_magic,"!<arch>",7) != 0)
-               error_msg_and_die("invalid magic\n");
+               error_msg_and_die("invalid magic");
 
        while (full_read(srcFd, (char *) &raw_ar_header, 60)==60) {
                /* check the end of header markers are valid */
@@ -168,7 +168,7 @@ extern int ar_main(int argc, char **argv)
                usage(ar_usage);
        
        if ( (srcFd = open(argv[optind], O_RDONLY)) < 0)
-               error_msg_and_die("Cannot read %s\n", argv[optind]);
+               error_msg_and_die("Cannot read %s", argv[optind]);
 
        optind++;       
        head = get_headers(srcFd);
index 3a789379b439217d7be5b69e392d49db4ab7572d..3345c273f5e1c8ff34f2f480cc65fc67e552aa8b 100644 (file)
@@ -118,7 +118,7 @@ extern int dpkg_deb_main(int argc, char **argv)
                extract_flag = TRUE;
                strcpy(ar_filename, "data.tar.gz");
                if ( (optind + 2) > argc ) {
-                       error_msg_and_die("No directory specified\n");
+                       error_msg_and_die("No directory specified");
                }
                target_dir = (char *) xmalloc(strlen(argv[optind+1]));                  
                strcpy(target_dir, argv[optind+1]);
@@ -128,7 +128,7 @@ extern int dpkg_deb_main(int argc, char **argv)
                list_flag = TRUE;
                strcpy(ar_filename, "data.tar.gz");
                if ( (optind + 2) > argc ) {
-                       error_msg_and_die("No directory specified\n");
+                       error_msg_and_die("No directory specified");
                }
                target_dir = (char *) xmalloc(strlen(argv[optind+1]));                  
                strcpy(target_dir, argv[optind+1]);
@@ -139,7 +139,7 @@ extern int dpkg_deb_main(int argc, char **argv)
        
        *ar_headers = get_headers(srcFd);
        if (ar_headers->next==NULL)
-               error_msg_and_die("Couldnt find %s in %s\n",ar_filename, argv[optind]);
+               error_msg_and_die("Couldnt find %s in %s", ar_filename, argv[optind]);
 
        while (ar_headers->next != NULL) {
                if (strcmp(ar_headers->name, ar_filename)==0)
@@ -154,7 +154,7 @@ extern int dpkg_deb_main(int argc, char **argv)
                        mkdir(target_dir, 0755);
                }
                if (chdir(target_dir)==-1) {
-                       error_msg_and_die("Cannot change to dir %s\n",argv[optind+1]);
+                       error_msg_and_die("Cannot change to dir %s", argv[optind+1]);
                }
        }
        status = readTarFile(srcFd, extract_flag, list_flag, extract_to_stdout, verbose_flag, NULL, extract_list);
index 09571f91c19694d9a792432f61522c8eb1701a12..48a46083b71895edad731c14373be9f41f8560d1 100644 (file)
@@ -297,7 +297,7 @@ int in;                                     /* input file descriptor */
 
                method = (int) get_byte();
                if (method != DEFLATED) {
-                       error_msg("unknown method %d -- get newer version of gzip\n", method);
+                       error_msg("unknown method %d -- get newer version of gzip", method);
                        exit_code = ERROR;
                        return -1;
                }
@@ -1116,11 +1116,11 @@ int in, out;                                    /* input and output file descriptors */
                if (res == 3) {
                        error_msg(memory_exhausted);
                } else if (res != 0) {
-                       error_msg("invalid compressed data--format violated\n");
+                       error_msg("invalid compressed data--format violated");
                }
 
        } else {
-               error_msg("internal error, invalid method\n");
+               error_msg("internal error, invalid method");
        }
 
        /* Get the crc and original length */
@@ -1149,15 +1149,15 @@ int in, out;                                    /* input and output file descriptors */
 
        /* Validate decompression */
        if (orig_crc != updcrc(outbuf, 0)) {
-               error_msg("invalid compressed data--crc error\n");
+               error_msg("invalid compressed data--crc error");
        }
        if (orig_len != (ulg) bytes_out) {
-               error_msg("invalid compressed data--length error\n");
+               error_msg("invalid compressed data--length error");
        }
 
        /* Check if there are more entries in a pkzip file */
        if (pkzip && inptr + 4 < insize && LG(inbuf + inptr) == LOCSIG) {
-               fprintf(stderr, "has more than one entry--rest ignored\n");
+               error_msg("has more than one entry--rest ignored");
                if (exit_code == OK)
                        exit_code = WARNING;
        }
@@ -1261,9 +1261,9 @@ int gunzip_main(int argc, char **argv)
        }
 
        if (isatty(fileno(stdin)) && fromstdin==1 && force==0)
-               error_msg_and_die( "data not read from terminal. Use -f to force it.\n");
+               error_msg_and_die( "data not read from terminal. Use -f to force it.");
        if (isatty(fileno(stdout)) && tostdout==1 && force==0)
-               error_msg_and_die( "data not written to terminal. Use -f to force it.\n");
+               error_msg_and_die( "data not written to terminal. Use -f to force it.");
 
        gunzip_init();
 
index 5a74868c19d4adec4ae458fad66d8e213f9458dd..75f3caa359c0e080a8d5648a930667a8711c25cf 100644 (file)
@@ -1382,7 +1382,7 @@ int length;
                           (char *) window + start, length) != EQUAL) {
                fprintf(stderr,
                                " start %d, match %d, length %d\n", start, match, length);
-               error_msg("invalid match\n");
+               error_msg("invalid match");
        }
        if (verbose > 1) {
                fprintf(stderr, "\\[%d,%d]", start - match, length);
@@ -1822,9 +1822,9 @@ int gzip_main(int argc, char **argv)
        }
 
        if (isatty(fileno(stdin)) && fromstdin==1 && force==0)
-               error_msg_and_die( "data not read from terminal. Use -f to force it.\n");
+               error_msg_and_die( "data not read from terminal. Use -f to force it.");
        if (isatty(fileno(stdout)) && tostdout==1 && force==0)
-               error_msg_and_die( "data not written to terminal. Use -f to force it.\n");
+               error_msg_and_die( "data not written to terminal. Use -f to force it.");
 
        foreground = signal(SIGINT, SIG_IGN) != SIG_IGN;
        if (foreground) {
@@ -2894,7 +2894,7 @@ int eof;                                          /* true if this is the last block for a file */
 #endif
                /* Since LIT_BUFSIZE <= 2*WSIZE, the input data must be there: */
                if (buf == (char *) 0)
-                       error_msg("block vanished\n");
+                       error_msg("block vanished");
 
                copy_block(buf, (unsigned) stored_len, 0);      /* without header */
                compressed_len = stored_len << 3;
@@ -3077,7 +3077,7 @@ local void set_file_type()
                bin_freq += dyn_ltree[n++].Freq;
        *file_type = bin_freq > (ascii_freq >> 2) ? BINARY : ASCII;
        if (*file_type == BINARY && translate_eol) {
-               error_msg("-l used on binary file\n");
+               error_msg("-l used on binary file");
        }
 }
 
@@ -3239,7 +3239,7 @@ char *env;                                                /* name of environment variable */
 
        /* Copy the program name first */
        if (oargc-- < 0)
-               error_msg("argc<=0\n");
+               error_msg("argc<=0");
        *(nargv++) = *(oargv++);
 
        /* Then copy the environment args */
index 3082914550a32672d10dcd8ed4270092be31219e..60744e8db91740256fc37398f8616375165305d6 100644 (file)
@@ -165,10 +165,10 @@ extern int tar_unzip_init(int tarFd)
        signal(SIGCHLD, child_died);
 
        if (pipe(unzip_pipe)!=0)
-               error_msg_and_die("pipe error\n");
+               error_msg_and_die("pipe error");
 
        if ( (child_pid = fork()) == -1)
-               error_msg_and_die("fork failure\n");
+               error_msg_and_die("fork failure");
 
        if (child_pid==0) {
                /* child process */
@@ -259,7 +259,7 @@ extern int tar_main(int argc, char **argv)
                                break;
                        case 'f':
                                if (*tarName != '-')
-                                       error_msg_and_die( "Only one 'f' option allowed\n");
+                                       error_msg_and_die( "Only one 'f' option allowed");
                                tarName = optarg;
                                break;
 #if defined BB_FEATURE_TAR_EXCLUDE
@@ -294,11 +294,11 @@ extern int tar_main(int argc, char **argv)
         */
        if (createFlag == TRUE) {
 #ifndef BB_FEATURE_TAR_CREATE
-               error_msg_and_die( "This version of tar was not compiled with tar creation support.\n");
+               error_msg_and_die( "This version of tar was not compiled with tar creation support.");
 #else
 #ifdef BB_FEATURE_TAR_GZIP
                if (unzipFlag==TRUE)
-                       error_msg_and_die("Creation of compressed not internally support by tar, pipe to busybox gunzip\n");
+                       error_msg_and_die("Creation of compressed not internally support by tar, pipe to busybox gunzip");
 #endif
                status = writeTarFile(tarName, verboseFlag, argv + optind, excludeList);
 #endif
@@ -330,7 +330,7 @@ extern int tar_main(int argc, char **argv)
                return EXIT_FAILURE;
 
   flagError:
-       error_msg_and_die( "Exactly one of 'c', 'x' or 't' must be specified\n");
+       error_msg_and_die( "Exactly one of 'c', 'x' or 't' must be specified");
 }
                                        
 static void
@@ -383,7 +383,7 @@ tarExtractRegularFile(TarInfo *header, int extractFlag, int tostdoutFlag)
                }
                if ( (readSize = full_read(header->tarFd, buffer, readSize)) <= 0 ) {
                        /* Tarball seems to have a problem */
-                       error_msg("Unexpected EOF in archive\n"); 
+                       error_msg("Unexpected EOF in archive"); 
                        return( FALSE);
                }
                if ( readSize < writeSize )
@@ -476,7 +476,7 @@ tarExtractSymLink(TarInfo *header, int extractFlag, int tostdoutFlag)
        /* Do not change permissions or date on symlink,
         * since it changes the pointed to file instead.  duh. */
 #else
-       error_msg("%s: Cannot create symlink to '%s': %s\n", 
+       error_msg("%s: Cannot create symlink to '%s': %s", 
                        header->name, header->linkname, 
                        "symlinks not supported"); 
 #endif
@@ -543,7 +543,7 @@ readTarHeader(struct TarHeader *rawHeader, struct TarInfo *header)
                        ++*(header->name);
 
                if (alreadyWarned == FALSE) {
-                       error_msg("Removing leading '/' from member names\n");
+                       error_msg("Removing leading '/' from member names");
                        alreadyWarned = TRUE;
                }
        }
@@ -644,7 +644,7 @@ extern int readTarFile(int tarFd, int extractFlag, int listFlag,
                                goto endgame;
                        } else {
                                errorFlag=TRUE;
-                               error_msg("Bad tar header, skipping\n");
+                               error_msg("Bad tar header, skipping");
                                continue;
                        }
                }
@@ -791,7 +791,7 @@ extern int readTarFile(int tarFd, int extractFlag, int listFlag,
                                break;
 #endif
                        default:
-                               error_msg("Unknown file type '%c' in tar file\n", header.type);
+                               error_msg("Unknown file type '%c' in tar file", header.type);
                                close( tarFd);
                                return( FALSE);
                }
@@ -803,7 +803,7 @@ extern int readTarFile(int tarFd, int extractFlag, int listFlag,
                return ( FALSE);
        }
        else if (errorFlag==TRUE) {
-               error_msg( "Error exit delayed from previous errors\n");
+               error_msg( "Error exit delayed from previous errors");
                return( FALSE);
        } else 
                return( status);
@@ -813,7 +813,7 @@ endgame:
        close( tarFd);
        if ( *(header.name) == '\0' ) {
                if (errorFlag==TRUE)
-                       error_msg( "Error exit delayed from previous errors\n");
+                       error_msg( "Error exit delayed from previous errors");
                else
                        return( TRUE);
        } 
@@ -1002,7 +1002,7 @@ writeTarHeader(struct TarBallInfo *tbInfo, const char *header_name,
                header.typeflag  = REGTYPE;
                putOctal(header.size, sizeof(header.size), statbuf->st_size);
        } else {
-               error_msg("%s: Unknown file type\n", real_name);
+               error_msg("%s: Unknown file type", real_name);
                return ( FALSE);
        }
 
@@ -1061,7 +1061,7 @@ static int writeFileToTarball(const char *fileName, struct stat *statbuf, void*
 
        /* It is against the rules to archive a socket */
        if (S_ISSOCK(statbuf->st_mode)) {
-               error_msg("%s: socket ignored\n", fileName);
+               error_msg("%s: socket ignored", fileName);
                return( TRUE);
        }
 
@@ -1070,7 +1070,7 @@ static int writeFileToTarball(const char *fileName, struct stat *statbuf, void*
         * the new tarball */
        if (tbInfo->statBuf.st_dev == statbuf->st_dev &&
                        tbInfo->statBuf.st_ino == statbuf->st_ino) {
-               error_msg("%s: file is the archive; skipping\n", fileName);
+               error_msg("%s: file is the archive; skipping", fileName);
                return( TRUE);
        }
 
@@ -1078,7 +1078,7 @@ static int writeFileToTarball(const char *fileName, struct stat *statbuf, void*
        while (header_name[0] == '/') {
                static int alreadyWarned=FALSE;
                if (alreadyWarned==FALSE) {
-                       error_msg("Removing leading '/' from member names\n");
+                       error_msg("Removing leading '/' from member names");
                        alreadyWarned=TRUE;
                }
                header_name++;
@@ -1111,7 +1111,7 @@ static int writeFileToTarball(const char *fileName, struct stat *statbuf, void*
 
                /* open the file we want to archive, and make sure all is well */
                if ((inputFileFd = open(fileName, O_RDONLY)) < 0) {
-                       error_msg("%s: Cannot open: %s\n", fileName, strerror(errno));
+                       error_msg("%s: Cannot open: %s", fileName, strerror(errno));
                        return( FALSE);
                }
                
@@ -1150,7 +1150,7 @@ static int writeTarFile(const char* tarName, int verboseFlag, char **argv,
 
        /* Make sure there is at least one file to tar up.  */
        if (*argv == NULL)
-               error_msg_and_die("Cowardly refusing to create an empty archive\n");
+               error_msg_and_die("Cowardly refusing to create an empty archive");
 
        /* Open the tar file for writing.  */
        if (!strcmp(tarName, "-"))
@@ -1193,7 +1193,7 @@ static int writeTarFile(const char* tarName, int verboseFlag, char **argv,
        /* Hang up the tools, close up shop, head home */
        close(tarFd);
        if (errorFlag == TRUE) {
-               error_msg("Error exit delayed from previous errors\n");
+               error_msg("Error exit delayed from previous errors");
                freeHardLinkInfo(&tbInfo.hlInfoHead);
                return(FALSE);
        }
index e56d2a4ed805e9b2112e559ddcfd9cf268d9608b..f10467a3bea29d28d4a443d64bf1c67a65204564 100644 (file)
--- a/busybox.c
+++ b/busybox.c
@@ -113,7 +113,7 @@ int main(int argc, char **argv)
                exit((*(applet->main)) (argc, argv));
        }
 
-       error_msg_and_die("applet not found\n");
+       error_msg_and_die("applet not found");
 }
 
 
index 178138a3ba120422a7d15ced1184c7f2a9e3972e..81db1015188ae1d93e19f01cdcd6544dfac5dd84 100644 (file)
@@ -65,7 +65,7 @@ static int fileAction(const char *fileName, struct stat *statbuf, void* junk)
        case CHMOD_APP:
                /* Parse the specified modes */
                if (parse_mode(theMode, &(statbuf->st_mode)) == FALSE) {
-                       error_msg_and_die( "unknown mode: %s\n", theMode);
+                       error_msg_and_die( "unknown mode: %s", theMode);
                }
                if (chmod(fileName, statbuf->st_mode) == 0)
                        return (TRUE);
@@ -150,7 +150,7 @@ int chmod_chown_chgrp_main(int argc, char **argv)
                        if (*argv == p)
                                uid = my_getpwnam(*argv);
                        if (uid == -1) {
-                               error_msg_and_die( "unknown user name: %s\n", *argv);
+                               error_msg_and_die( "unknown user name: %s", *argv);
                        }
                }
        }
@@ -167,7 +167,7 @@ int chmod_chown_chgrp_main(int argc, char **argv)
        return EXIT_SUCCESS;
 
   bad_group:
-       error_msg_and_die( "unknown group name: %s\n", groupName);
+       error_msg_and_die( "unknown group name: %s", groupName);
 }
 
 /*
index 1690326976ff52d5637adbcd56523b24b286fa12..ed441d39406b790f488dd8f3d49982ceac168f42 100644 (file)
--- a/cmdedit.c
+++ b/cmdedit.c
@@ -318,7 +318,7 @@ static void cmdedit_setwidth(int w, int redraw_flg)
                                input_backward();
                }
        } else {
-               error_msg("\n*** Error: minimum screen width is %d\n", cmdedit_termw);
+               error_msg("\n*** Error: minimum screen width is %d", cmdedit_termw);
        }
 }
 
index fad7a2bb211567a80f83e88cbe624af550516610..b51fbaef442607dbdeb04160c3d07163e8907acf 100644 (file)
@@ -31,9 +31,9 @@ int deallocvt_main(int argc, char *argv[])
                for (i = 1; i < argc; i++) {
                        num = atoi(argv[i]);
                        if (num == 0)
-                               error_msg("0: illegal VT number\n");
+                               error_msg("0: illegal VT number");
                        else if (num == 1)
-                               error_msg("VT 1 cannot be deallocated\n");
+                               error_msg("VT 1 cannot be deallocated");
                        else if (ioctl(fd, VT_DISALLOCATE, num))
                                perror_msg_and_die("VT_DISALLOCATE");
                }
index b2067b30ca941b0e918423ae907e615c2a6896d3..4ab711e5507eb30b2e2829ac37480127688eba25 100644 (file)
@@ -81,7 +81,7 @@ int dumpkmap_main(int argc, char **argv)
                                ke.kb_table = i;
                                if (ioctl(fd, KDGKBENT, &ke) < 0) {
                                
-                                       error_msg("ioctl returned: %s, %s, %s, %xqq\n",strerror(errno),(char *)&ke.kb_index,(char *)&ke.kb_table,(int)&ke.kb_value);
+                                       error_msg("ioctl returned: %s, %s, %s, %xqq", strerror(errno),(char *)&ke.kb_index,(char *)&ke.kb_table,(int)&ke.kb_value);
                                        }
                                else {
                                        write(1,(void*)&ke.kb_value,2); 
index 040062cf8ce69140343d67302a4f285a9ee92b8e..345a2773cf147db374cf375f6413201d5afd67e1 100644 (file)
@@ -70,7 +70,7 @@ int screen_map_load(int fd, FILE * fp)
                if (parse_failed) {
                        if (-1 == fseek(fp, 0, SEEK_SET)) {
                                if (errno == ESPIPE)
-                                       error_msg_and_die("16bit screen-map MUST be a regular file.\n");
+                                       error_msg_and_die("16bit screen-map MUST be a regular file.");
                                else
                                        perror_msg_and_die("fseek failed reading binary 16bit screen-map");
                        }
@@ -79,7 +79,7 @@ int screen_map_load(int fd, FILE * fp)
                                perror_msg_and_die("Cannot read [new] map from file");
 #if 0
                        else
-                               error_msg("Input screen-map is binary.\n");
+                               error_msg("Input screen-map is binary.");
 #endif
                }
 
@@ -96,7 +96,7 @@ int screen_map_load(int fd, FILE * fp)
        /* rewind... */
        if (-1 == fseek(fp, 0, SEEK_SET)) {
                if (errno == ESPIPE)
-                       error_msg("Assuming 8bit screen-map - MUST be a regular file.\n"),
+                       error_msg("Assuming 8bit screen-map - MUST be a regular file."),
                                exit(1);
                else
                        perror_msg_and_die("fseek failed assuming 8bit screen-map");
@@ -109,7 +109,7 @@ int screen_map_load(int fd, FILE * fp)
                        if (-1 == fseek(fp, 0, SEEK_SET)) {
                                if (errno == ESPIPE)
                                        /* should not - it succedeed above */
-                                       error_msg_and_die("fseek() returned ESPIPE !\n");
+                                       error_msg_and_die("fseek() returned ESPIPE !");
                                else
                                        perror_msg_and_die("fseek for binary 8bit screen-map");
                        }
@@ -118,7 +118,7 @@ int screen_map_load(int fd, FILE * fp)
                                perror_msg_and_die("Cannot read [old] map from file");
 #if 0
                        else
-                               error_msg("Input screen-map is binary.\n");
+                               error_msg("Input screen-map is binary.");
 #endif
                }
 
@@ -127,7 +127,7 @@ int screen_map_load(int fd, FILE * fp)
                else
                        return 0;
        }
-       error_msg("Error parsing symbolic map\n");
+       error_msg("Error parsing symbolic map");
        return(1);
 }
 
index 08e07618e4660a052519c053a168e79172801976..ec3e50560777e298233e535200fd5ff54f2d9a00 100644 (file)
@@ -62,7 +62,7 @@ static void do_loadfont(int fd, char *inbuf, int unit, int fontsize)
        memset(buf, 0, sizeof(buf));
 
        if (unit < 1 || unit > 32)
-               error_msg_and_die("Bad character size %d\n", unit);
+               error_msg_and_die("Bad character size %d", unit);
 
        for (i = 0; i < fontsize; i++)
                memcpy(buf + (32 * i), inbuf + (unit * i), unit);
@@ -119,8 +119,8 @@ do_loadtable(int fd, unsigned char *inbuf, int tailsz, int fontsize)
        if (ioctl(fd, PIO_UNIMAPCLR, &advice)) {
 #ifdef ENOIOCTLCMD
                if (errno == ENOIOCTLCMD) {
-                       error_msg("It seems this kernel is older than 1.1.92\n");
-                       error_msg_and_die("No Unicode mapping table loaded.\n");
+                       error_msg("It seems this kernel is older than 1.1.92");
+                       error_msg_and_die("No Unicode mapping table loaded.");
                } else
 #endif
                        perror_msg_and_die("PIO_UNIMAPCLR");
@@ -174,11 +174,11 @@ static void loadnewfont(int fd)
                        goto no_psf;
 
                if (psfhdr.mode > PSF_MAXMODE)
-                       error_msg_and_die("Unsupported psf file mode\n");
+                       error_msg_and_die("Unsupported psf file mode");
                fontsize = ((psfhdr.mode & PSF_MODE512) ? 512 : 256);
 #if !defined( PIO_FONTX ) || defined( __sparc__ )
                if (fontsize != 256)
-                       error_msg_and_die("Only fontsize 256 supported\n");
+                       error_msg_and_die("Only fontsize 256 supported");
 #endif
                hastable = (psfhdr.mode & PSF_MODEHASTAB);
                unit = psfhdr.charsize;
@@ -186,7 +186,7 @@ static void loadnewfont(int fd)
 
                head = head0 + fontsize * unit;
                if (head > inputlth || (!hastable && head != inputlth))
-                       error_msg_and_die("Input file: bad length\n");
+                       error_msg_and_die("Input file: bad length");
                do_loadfont(fd, inbuf + head0, unit, fontsize);
                if (hastable)
                        do_loadtable(fd, inbuf + head, inputlth - head, fontsize);
@@ -201,7 +201,7 @@ static void loadnewfont(int fd)
        } else {
                /* bare font */
                if (inputlth & 0377)
-                       error_msg_and_die("Bad input file size\n");
+                       error_msg_and_die("Bad input file size");
                offset = 0;
                unit = inputlth / 256;
        }
index 75b40da9aa672ac18f38946c9ca05b13799b2459..a98601aec9c2dff53be8c458d9b1170e5f68f886 100644 (file)
@@ -59,7 +59,7 @@ int loadkmap_main(int argc, char **argv)
 
        read(0, buff, 7);
        if (0 != strncmp(buff, BINARY_KEYMAP_MAGIC, 7))
-               error_msg_and_die("This is not a valid binary keymap.\n");
+               error_msg_and_die("This is not a valid binary keymap.");
 
        if (MAX_NR_KEYMAPS != read(0, flags, MAX_NR_KEYMAPS))
                perror_msg_and_die("Error reading keymap flags");
index be9b1b79769a79f2bca59323c2768dde81c046f4..3e511ad00d46fcd516b9d009afa8446c675814c5 100644 (file)
@@ -52,18 +52,18 @@ setkeycodes_main(int argc, char** argv)
        a.keycode = atoi(argv[2]);
        a.scancode = sc = strtol(argv[1], &ep, 16);
        if (*ep) {
-      error_msg_and_die("error reading SCANCODE: '%s'\n", argv[1]);
+      error_msg_and_die("error reading SCANCODE: '%s'", argv[1]);
        }
        if (a.scancode > 127) {
            a.scancode -= 0xe000;
            a.scancode += 128;
        }
        if (a.scancode > 255 || a.keycode > 127) {
-      error_msg_and_die("SCANCODE or KEYCODE outside bounds\n");
+      error_msg_and_die("SCANCODE or KEYCODE outside bounds");
        }
        if (ioctl(fd,KDSETKEYCODE,&a)) {
            perror("KDSETKEYCODE");
-               error_msg_and_die("failed to set SCANCODE %x to KEYCODE %d\n", sc, a.keycode);
+               error_msg_and_die("failed to set SCANCODE %x to KEYCODE %d", sc, a.keycode);
        }
        argc -= 2;
        argv += 2;
index ed68657dfaf4300d4063a6493e500f27ee12e9ab..7e9a72e3f7ba67eeef659bf544b5afe6f624f4a8 100644 (file)
@@ -54,12 +54,12 @@ static void decompose_list(const char *list)
        /* the list must contain only digits and no more than one minus sign */
        for (ptr = (char *)list; *ptr; ptr++) {
                if (!isdigit(*ptr) && *ptr != '-') {
-                       error_msg_and_die("invalid byte or field list\n");
+                       error_msg_and_die("invalid byte or field list");
                }
                if (*ptr == '-') {
                        nminus++;
                        if (nminus > 1) {
-                               error_msg_and_die("invalid byte or field list\n");
+                               error_msg_and_die("invalid byte or field list");
                        }
                }
        }
@@ -68,7 +68,7 @@ static void decompose_list(const char *list)
        if (nminus == 0) {
                startpos = strtol(list, &ptr, 10);
                if (startpos == 0) {
-                       error_msg_and_die("missing list of fields\n");
+                       error_msg_and_die("missing list of fields");
                }
                endpos = startpos;
        }
@@ -188,14 +188,14 @@ extern int cut_main(int argc, char **argv)
                        case 'f':
                                /* make sure they didn't ask for two types of lists */
                                if (part != 0) {
-                                       error_msg_and_die("only one type of list may be specified\n");
+                                       error_msg_and_die("only one type of list may be specified");
                                }
                                part = (char)opt;
                                decompose_list(optarg);
                                break;
                        case 'd':
                                if (strlen(optarg) > 1) {
-                                       error_msg_and_die("the delimiter must be a single character\n");
+                                       error_msg_and_die("the delimiter must be a single character");
                                }
                                delim = optarg[0];
                                break;
@@ -209,17 +209,17 @@ extern int cut_main(int argc, char **argv)
        }
 
        if (part == 0) {
-               error_msg_and_die("you must specify a list of bytes, characters, or fields\n");
+               error_msg_and_die("you must specify a list of bytes, characters, or fields");
        }
 
        if (supress_non_delimited_lines && part != 'f') {
                error_msg_and_die("suppressing non-delimited lines makes sense"
-                               " only when operating on fields\n");
+                               " only when operating on fields");
 
        }
 
        if (delim != '\t' && part != 'f') {
-               error_msg_and_die("a delimiter may be specified only when operating on fields\n");
+               error_msg_and_die("a delimiter may be specified only when operating on fields");
        }
 
        /* argv[(optind)..(argc-1)] should be names of file to process. If no
index dac9ccdf3907fd06fc1d00902ea4922bdaeb2423..582310681eb83f781ee10427f9c62a142fbe2398 100644 (file)
@@ -76,7 +76,7 @@ int dd_main(int argc, char **argv)
                                        sync = TRUE;
                                        buf += 4;
                                } else {
-                                       error_msg_and_die("invalid conversion `%s'\n", argv[i]+5);
+                                       error_msg_and_die("invalid conversion `%s'", argv[i]+5);
                                }
                                if (buf[0] == '\0')
                                        break;
index 7a24fedd05912da3585771fed881c74b7b63fb76..55919793c2588ebe017675ec9cec7572bb4ed99c 100644 (file)
@@ -118,7 +118,7 @@ extern int df_main(int argc, char **argv)
                for(i = optind; i < argc; i++)
                {
                        if ((mountEntry = find_mount_point(argv[i], mtab_file)) == 0) {
-                               error_msg("%s: can't find mount point.\n", argv[i]);
+                               error_msg("%s: can't find mount point.", argv[i]);
                                status = EXIT_FAILURE;
                        } else if (!df(mountEntry->mnt_fsname, mountEntry->mnt_dir))
                                status = EXIT_FAILURE;
index 71bd22417bd215d5406608ccebde304519455957..8ef5293c1d86771fd503ebb15a38964db00af984 100644 (file)
@@ -76,14 +76,14 @@ int expr_main (int argc, char **argv)
        VALUE *v;
 
        if (argc == 1) {
-               error_msg_and_die("too few arguments\n");
+               error_msg_and_die("too few arguments");
        }
 
        args = argv + 1;
 
        v = eval ();
        if (*args)
-               error_msg_and_die ("syntax error\n");
+               error_msg_and_die ("syntax error");
 
        if (v->type == integer)
                printf ("%d\n", v->u.i);
@@ -218,7 +218,7 @@ static                                              \
 int name (l, r) VALUE *l; VALUE *r;            \
 {                                              \
   if (!toarith (l) || !toarith (r))            \
-    error_msg_and_die ("non-numeric argument\n");      \
+    error_msg_and_die ("non-numeric argument");        \
   return l->u.i op r->u.i;                     \
 }
 
@@ -226,9 +226,9 @@ int name (l, r) VALUE *l; VALUE *r;         \
 int name (l, r) VALUE *l; VALUE *r;            \
 {                                              \
   if (!toarith (l) || !toarith (r))            \
-    error_msg_and_die ( "non-numeric argument\n");     \
+    error_msg_and_die ( "non-numeric argument");       \
   if (r->u.i == 0)                             \
-    error_msg_and_die ( "division by zero\n");         \
+    error_msg_and_die ( "division by zero");           \
   return l->u.i op r->u.i;                     \
 }
 
@@ -272,7 +272,7 @@ of a basic regular expression is not portable; it is being ignored",
        re_syntax_options = RE_SYNTAX_POSIX_BASIC;
        errmsg = re_compile_pattern (pv->u.s, len, &re_buffer);
        if (errmsg) {
-               error_msg_and_die("%s\n", errmsg);
+               error_msg_and_die("%s", errmsg);
        }
 
        len = re_match (&re_buffer, sv->u.s, strlen (sv->u.s), 0, &re_regs);
@@ -303,19 +303,19 @@ static VALUE *eval7 (void)
        VALUE *v;
 
        if (!*args)
-               error_msg_and_die ( "syntax error\n");
+               error_msg_and_die ( "syntax error");
 
        if (nextarg ("(")) {
                args++;
                v = eval ();
                if (!nextarg (")"))
-                       error_msg_and_die ( "syntax error\n");
+                       error_msg_and_die ( "syntax error");
                        args++;
                        return v;
                }
 
        if (nextarg (")"))
-               error_msg_and_die ( "syntax error\n");
+               error_msg_and_die ( "syntax error");
 
        return str_value (*args++);
 }
@@ -329,7 +329,7 @@ static VALUE *eval6 (void)
        if (nextarg ("quote")) {
                args++;
                if (!*args)
-                       error_msg_and_die ( "syntax error\n");
+                       error_msg_and_die ( "syntax error");
                return str_value (*args++);
        }
        else if (nextarg ("length")) {
index e91ac758570e7b3e4ef9ef042611507bb65d068e..650e3db20c8323138ae986e2f486917602f459ed 100644 (file)
@@ -77,7 +77,7 @@ extern int id_main(int argc, char **argv)
        pwnam=my_getpwnam(user);
        grnam=my_getgrnam(group);
        if (gid == -1 || pwnam==-1 || grnam==-1) {
-               error_msg_and_die("%s: No such user\n", user);
+               error_msg_and_die("%s: No such user", user);
        }
 
        if (no_group) {
index edec016e67a4e9077e2a1749066f632614bba311..d9056c69da364cf37deb593b0eadd2896eaf2483 100644 (file)
@@ -37,5 +37,5 @@ extern int logname_main(int argc, char **argv)
                puts(user);
                return EXIT_SUCCESS;
        }
-       error_msg_and_die("no login name\n");
+       error_msg_and_die("no login name");
 }
index ad4078040138da8e9dfd2587f0e8da5340dc27f3..97a940059ed98088bba393274ea44431542f17e0 100644 (file)
@@ -719,7 +719,7 @@ static int md5_check(const char *checkfile_name)
     if (split_3(line, line_length, &md5num, &binary, &filename)
         || !hex_digits(md5num)) {
       if (warn) {
-        error_msg("%s: %lu: improperly formatted MD5 checksum line\n",
+        error_msg("%s: %lu: improperly formatted MD5 checksum line",
                  checkfile_name, (unsigned long) line_number);
       }
     } else {
@@ -764,7 +764,7 @@ static int md5_check(const char *checkfile_name)
   while (!feof(checkfile_stream) && !ferror(checkfile_stream));
 
   if (ferror(checkfile_stream)) {
-    error_msg("%s: read error\n", checkfile_name); /* */
+    error_msg("%s: read error", checkfile_name);
     return FALSE;
   }
 
@@ -775,7 +775,7 @@ static int md5_check(const char *checkfile_name)
 
   if (n_properly_formated_lines == 0) {
     /* Warn if no tests are found.  */
-    error_msg("%s: no properly formatted MD5 checksum lines found\n",
+    error_msg("%s: no properly formatted MD5 checksum lines found",
              checkfile_name);
     return FALSE;
   } else {
@@ -784,13 +784,13 @@ static int md5_check(const char *checkfile_name)
                                  - n_open_or_read_failures);
 
       if (n_open_or_read_failures > 0) {
-        error_msg("WARNING: %d of %d listed files could not be read\n",
+        error_msg("WARNING: %d of %d listed files could not be read",
                  n_open_or_read_failures, n_properly_formated_lines);
         return FALSE;
       }
 
       if (n_mismatched_checksums > 0) {
-        error_msg("WARNING: %d of %d computed checksums did NOT match\n",
+        error_msg("WARNING: %d of %d computed checksums did NOT match",
                  n_mismatched_checksums, n_computed_checkums);
         return FALSE;
       }
@@ -855,26 +855,26 @@ int md5sum_main(int argc,
   }
 
   if (file_type_specified && do_check) {
-    error_msg_and_die("the -b and -t options are meaningless when verifying checksums\n");
+    error_msg_and_die("the -b and -t options are meaningless when verifying checksums");
   }
 
   if (n_strings > 0 && do_check) {
-    error_msg_and_die("the -g and -c options are mutually exclusive\n");
+    error_msg_and_die("the -g and -c options are mutually exclusive");
   }
 
   if (status_only && !do_check) {
-    error_msg_and_die("the -s option is meaningful only when verifying checksums\n");
+    error_msg_and_die("the -s option is meaningful only when verifying checksums");
   }
 
   if (warn && !do_check) {
-    error_msg_and_die("the -w option is meaningful only when verifying checksums\n");
+    error_msg_and_die("the -w option is meaningful only when verifying checksums");
   }
 
   if (n_strings > 0) {
     size_t i;
 
     if (optind < argc) {
-      error_msg_and_die("no files may be specified when using -g\n");
+      error_msg_and_die("no files may be specified when using -g");
     }
     for (i = 0; i < n_strings; ++i) {
       size_t cnt;
@@ -887,7 +887,7 @@ int md5sum_main(int argc,
     }
   } else if (do_check) {
     if (optind + 1 < argc) {
-      error_msg("only one argument may be specified when using -c\n");
+      error_msg("only one argument may be specified when using -c");
     }
 
     err = md5_check ((optind == argc) ? "-" : argv[optind]);
@@ -940,11 +940,11 @@ int md5sum_main(int argc,
   }
 
   if (fclose (stdout) == EOF) {
-    error_msg_and_die("write error\n");
+    error_msg_and_die("write error");
   }
 
   if (have_read_stdin && fclose (stdin) == EOF) {
-    error_msg_and_die("standard input\n");
+    error_msg_and_die("standard input");
   }
 
   if (err == 0)
index 07b18713a9a2e2bb72d213c01c03b3831ea48015..299f29806d3a7804d871f55966c6d528f9648891 100644 (file)
@@ -52,7 +52,7 @@ extern int mkdir_main(int argc, char **argv)
                                /* Find the specified modes */
                                mode = 0;
                                if (parse_mode(*(++argv), &mode) == FALSE) {
-                                       error_msg_and_die("Unknown mode: %s\n", *argv);
+                                       error_msg_and_die("Unknown mode: %s", *argv);
                                }
                                /* Set the umask for this process so it doesn't 
                                 * screw up whatever the user just entered. */
@@ -85,7 +85,7 @@ extern int mkdir_main(int argc, char **argv)
                strcpy(buf, *argv);
                status = stat(buf, &statBuf);
                if (parentFlag == FALSE && status != -1 && errno != ENOENT) {
-                       error_msg_and_die("%s: File exists\n", buf);
+                       error_msg_and_die("%s: File exists", buf);
                }
                if (parentFlag == TRUE) {
                        strcat(buf, "/");
index ba6feb033e879c616af48d586d29b03ffd4ce7e0..6439e3a8ae94f2d6edbea90d99273fc7e4854ba3 100644 (file)
@@ -184,7 +184,7 @@ test_main(int argc, char** argv)
 
        if (strcmp(applet_name, "[") == 0) {
                if (strcmp(argv[--argc], "]"))
-                       error_msg_and_die("missing ]\n");
+                       error_msg_and_die("missing ]");
                argv[argc] = NULL;
        }
        /* Implement special cases from POSIX.2, section 4.62.4 */
@@ -233,9 +233,9 @@ syntax(op, msg)
        char    *msg;
 {
        if (op && *op)
-               error_msg_and_die("%s: %s\n", op, msg);
+               error_msg_and_die("%s: %s", op, msg);
        else
-               error_msg_and_die("%s\n", msg);
+               error_msg_and_die("%s", msg);
 }
 
 static int
@@ -470,13 +470,13 @@ getn(s)
        r = strtol(s, &p, 10);
 
        if (errno != 0)
-         error_msg_and_die("%s: out of range\n", s);
+         error_msg_and_die("%s: out of range", s);
 
        while (isspace(*p))
          p++;
        
        if (*p)
-         error_msg_and_die("%s: bad number\n", s);
+         error_msg_and_die("%s: bad number", s);
 
        return (int) r;
 }
index 2717a92db74f11bbd2834db1bfa9f18042c2b1ce..36f29de446ce2cbeb91160830d8bb15ab409214d 100644 (file)
@@ -186,7 +186,7 @@ extern int tr_main(int argc, char **argv)
                        input_length = complement(input, input_length);
                if (argv[index] != NULL) {
                        if (*argv[index] == '\0')
-                               error_msg_and_die("STRING2 cannot be empty\n");
+                               error_msg_and_die("STRING2 cannot be empty");
                        output_length = expand(argv[index], output);
                        map(input, input_length, output, output_length);
                }
index fcfcfd903d22197fa7a5a898426c002859c8222a..cccc528729e62d3d0bc7951cc6c6f53b4878917f 100644 (file)
@@ -46,7 +46,7 @@ static int read_stduu (const char *inname)
     char *p;
 
     if (fgets (buf, sizeof(buf), stdin) == NULL) {
-      error_msg("%s: Short file\n", inname);
+      error_msg("%s: Short file", inname);
       return FALSE;
     }
     p = buf;
@@ -81,7 +81,7 @@ static int read_stduu (const char *inname)
 
   if (fgets (buf, sizeof(buf), stdin) == NULL
       || strcmp (buf, "end\n")) {
-    error_msg("%s: No `end' line\n", inname);
+    error_msg("%s: No `end' line", inname);
     return FALSE;
   }
 
@@ -131,7 +131,7 @@ static int read_base64 (const char *inname)
     unsigned char *p;
 
     if (fgets (buf, sizeof(buf), stdin) == NULL) {
-      error_msg("%s: Short file\n", inname);
+      error_msg("%s: Short file", inname);
       return FALSE;
     }
     p = buf;
@@ -139,7 +139,7 @@ static int read_base64 (const char *inname)
     if (memcmp (buf, "====", 4) == 0)
       break;
     if (last_data != 0) {
-      error_msg("%s: data following `=' padding character\n", inname);
+      error_msg("%s: data following `=' padding character", inname);
       return FALSE;
     }
 
@@ -161,14 +161,14 @@ static int read_base64 (const char *inname)
 
       while ((b64_tab[*p] & '\100') != 0)
         if (*p == '\n' || *p++ == '=') {
-          error_msg("%s: illegal line\n", inname);
+          error_msg("%s: illegal line", inname);
           return FALSE;
         }
       c2 = b64_tab[*p++];
 
       while (b64_tab[*p] == '\177')
         if (*p++ == '\n') {
-          error_msg("%s: illegal line\n", inname);
+          error_msg("%s: illegal line", inname);
           return FALSE;
         }
       if (*p == '=') {
@@ -180,7 +180,7 @@ static int read_base64 (const char *inname)
 
       while (b64_tab[*p] == '\177')
         if (*p++ == '\n') {
-          error_msg("%s: illegal line\n", inname);
+          error_msg("%s: illegal line", inname);
           return FALSE;
         }
       putchar (c1 << 2 | c2 >> 4);
@@ -212,7 +212,7 @@ static int decode (const char *inname,
 
   while (1) {
     if (fgets (buf, sizeof (buf), stdin) == NULL) {
-      error_msg("%s: No `begin' line\n", inname);
+      error_msg("%s: No `begin' line", inname);
       return FALSE;
     }
 
@@ -237,13 +237,13 @@ static int decode (const char *inname,
       while (*p != '/')
         ++p;
       if (*p == '\0') {
-        error_msg("%s: Illegal ~user\n", inname);
+        error_msg("%s: Illegal ~user", inname);
         return FALSE;
       }
       *p++ = '\0';
       pw = getpwnam (buf + 1);
       if (pw == NULL) {
-        error_msg("%s: No user `%s'\n", inname, buf + 1);
+        error_msg("%s: No user `%s'", inname, buf + 1);
         return FALSE;
       }
       n = strlen (pw->pw_dir);
index 5df49026b4f658e45d850efa179a3386c6ca769b..73098ba2648db9c703acf0a3c3478a9674e030ef 100644 (file)
@@ -142,7 +142,7 @@ static void encode()
   }
 
   if (ferror (stdin))
-    error_msg("Read error\n");
+    error_msg("Read error");
 
   if (trans_ptr == uu_std) {
     putchar (ENC ('\0'));
@@ -196,7 +196,7 @@ int uuencode_main (int argc,
   encode();
   printf(trans_ptr == uu_std ? "end\n" : "====\n");
   if (ferror (stdout)) {
-    error_msg("Write error\n");
+    error_msg("Write error");
     return EXIT_FAILURE;
   }
   return EXIT_SUCCESS;
index 870ede43e9f7c9993321a24097e0d69e6deb6797..398e37315a8277a3aa1423dba34c9b05514b24f7 100644 (file)
@@ -38,5 +38,5 @@ extern int whoami_main(int argc, char **argv)
                puts(user);
                return EXIT_SUCCESS;
        }
-       error_msg_and_die("cannot find username for UID %u\n", (unsigned) uid);
+       error_msg_and_die("cannot find username for UID %u", (unsigned) uid);
 }
diff --git a/cp_mv.c b/cp_mv.c
index dbd2fddf56dae3e7aa5f844996afcab872125f20..9c109b5118de1170e22c3132c7f5bc041c3a4a8f 100644 (file)
--- a/cp_mv.c
+++ b/cp_mv.c
@@ -282,7 +282,7 @@ extern int cp_mv_main(int argc, char **argv)
                                if ((sb.st_ino == srcStatBuf.st_ino) &&
                                        (sb.st_dev == srcStatBuf.st_dev)) {
                                        error_msg("Cannot %s `%s' into a subdirectory of itself, "
-                                                       "`%s/%s'\n", applet_name, baseSrcName,
+                                                       "`%s/%s'", applet_name, baseSrcName,
                                                        baseDestName, baseSrcName);
                                        state = -1;
                                        continue;
diff --git a/cut.c b/cut.c
index ed68657dfaf4300d4063a6493e500f27ee12e9ab..7e9a72e3f7ba67eeef659bf544b5afe6f624f4a8 100644 (file)
--- a/cut.c
+++ b/cut.c
@@ -54,12 +54,12 @@ static void decompose_list(const char *list)
        /* the list must contain only digits and no more than one minus sign */
        for (ptr = (char *)list; *ptr; ptr++) {
                if (!isdigit(*ptr) && *ptr != '-') {
-                       error_msg_and_die("invalid byte or field list\n");
+                       error_msg_and_die("invalid byte or field list");
                }
                if (*ptr == '-') {
                        nminus++;
                        if (nminus > 1) {
-                               error_msg_and_die("invalid byte or field list\n");
+                               error_msg_and_die("invalid byte or field list");
                        }
                }
        }
@@ -68,7 +68,7 @@ static void decompose_list(const char *list)
        if (nminus == 0) {
                startpos = strtol(list, &ptr, 10);
                if (startpos == 0) {
-                       error_msg_and_die("missing list of fields\n");
+                       error_msg_and_die("missing list of fields");
                }
                endpos = startpos;
        }
@@ -188,14 +188,14 @@ extern int cut_main(int argc, char **argv)
                        case 'f':
                                /* make sure they didn't ask for two types of lists */
                                if (part != 0) {
-                                       error_msg_and_die("only one type of list may be specified\n");
+                                       error_msg_and_die("only one type of list may be specified");
                                }
                                part = (char)opt;
                                decompose_list(optarg);
                                break;
                        case 'd':
                                if (strlen(optarg) > 1) {
-                                       error_msg_and_die("the delimiter must be a single character\n");
+                                       error_msg_and_die("the delimiter must be a single character");
                                }
                                delim = optarg[0];
                                break;
@@ -209,17 +209,17 @@ extern int cut_main(int argc, char **argv)
        }
 
        if (part == 0) {
-               error_msg_and_die("you must specify a list of bytes, characters, or fields\n");
+               error_msg_and_die("you must specify a list of bytes, characters, or fields");
        }
 
        if (supress_non_delimited_lines && part != 'f') {
                error_msg_and_die("suppressing non-delimited lines makes sense"
-                               " only when operating on fields\n");
+                               " only when operating on fields");
 
        }
 
        if (delim != '\t' && part != 'f') {
-               error_msg_and_die("a delimiter may be specified only when operating on fields\n");
+               error_msg_and_die("a delimiter may be specified only when operating on fields");
        }
 
        /* argv[(optind)..(argc-1)] should be names of file to process. If no
diff --git a/dc.c b/dc.c
index d462100a21166e42c939915de6b0f761a1ed5253..122673a95a59d389edaf30d1438f7a020ff2d08f 100644 (file)
--- a/dc.c
+++ b/dc.c
@@ -14,14 +14,14 @@ static unsigned int pointer;
 static void push(double a)
 {
        if (pointer >= (sizeof(stack) / sizeof(*stack)))
-               error_msg_and_die("stack overflow\n");
+               error_msg_and_die("stack overflow");
        stack[pointer++] = a;
 }
 
 static double pop()
 {
        if (pointer == 0)
-               error_msg_and_die("stack underflow\n");
+               error_msg_and_die("stack underflow");
        return stack[--pointer];
 }
 
@@ -120,7 +120,7 @@ static void stack_machine(const char *argument)
                }
                o++;
        }
-       error_msg_and_die("%s: syntax error.\n", argument);
+       error_msg_and_die("%s: syntax error.", argument);
 }
 
 /* return pointer to next token in buffer and set *buffer to one char
diff --git a/dd.c b/dd.c
index dac9ccdf3907fd06fc1d00902ea4922bdaeb2423..582310681eb83f781ee10427f9c62a142fbe2398 100644 (file)
--- a/dd.c
+++ b/dd.c
@@ -76,7 +76,7 @@ int dd_main(int argc, char **argv)
                                        sync = TRUE;
                                        buf += 4;
                                } else {
-                                       error_msg_and_die("invalid conversion `%s'\n", argv[i]+5);
+                                       error_msg_and_die("invalid conversion `%s'", argv[i]+5);
                                }
                                if (buf[0] == '\0')
                                        break;
index fad7a2bb211567a80f83e88cbe624af550516610..b51fbaef442607dbdeb04160c3d07163e8907acf 100644 (file)
@@ -31,9 +31,9 @@ int deallocvt_main(int argc, char *argv[])
                for (i = 1; i < argc; i++) {
                        num = atoi(argv[i]);
                        if (num == 0)
-                               error_msg("0: illegal VT number\n");
+                               error_msg("0: illegal VT number");
                        else if (num == 1)
-                               error_msg("VT 1 cannot be deallocated\n");
+                               error_msg("VT 1 cannot be deallocated");
                        else if (ioctl(fd, VT_DISALLOCATE, num))
                                perror_msg_and_die("VT_DISALLOCATE");
                }
diff --git a/df.c b/df.c
index 7a24fedd05912da3585771fed881c74b7b63fb76..55919793c2588ebe017675ec9cec7572bb4ed99c 100644 (file)
--- a/df.c
+++ b/df.c
@@ -118,7 +118,7 @@ extern int df_main(int argc, char **argv)
                for(i = optind; i < argc; i++)
                {
                        if ((mountEntry = find_mount_point(argv[i], mtab_file)) == 0) {
-                               error_msg("%s: can't find mount point.\n", argv[i]);
+                               error_msg("%s: can't find mount point.", argv[i]);
                                status = EXIT_FAILURE;
                        } else if (!df(mountEntry->mnt_fsname, mountEntry->mnt_dir))
                                status = EXIT_FAILURE;
index 3a789379b439217d7be5b69e392d49db4ab7572d..3345c273f5e1c8ff34f2f480cc65fc67e552aa8b 100644 (file)
@@ -118,7 +118,7 @@ extern int dpkg_deb_main(int argc, char **argv)
                extract_flag = TRUE;
                strcpy(ar_filename, "data.tar.gz");
                if ( (optind + 2) > argc ) {
-                       error_msg_and_die("No directory specified\n");
+                       error_msg_and_die("No directory specified");
                }
                target_dir = (char *) xmalloc(strlen(argv[optind+1]));                  
                strcpy(target_dir, argv[optind+1]);
@@ -128,7 +128,7 @@ extern int dpkg_deb_main(int argc, char **argv)
                list_flag = TRUE;
                strcpy(ar_filename, "data.tar.gz");
                if ( (optind + 2) > argc ) {
-                       error_msg_and_die("No directory specified\n");
+                       error_msg_and_die("No directory specified");
                }
                target_dir = (char *) xmalloc(strlen(argv[optind+1]));                  
                strcpy(target_dir, argv[optind+1]);
@@ -139,7 +139,7 @@ extern int dpkg_deb_main(int argc, char **argv)
        
        *ar_headers = get_headers(srcFd);
        if (ar_headers->next==NULL)
-               error_msg_and_die("Couldnt find %s in %s\n",ar_filename, argv[optind]);
+               error_msg_and_die("Couldnt find %s in %s", ar_filename, argv[optind]);
 
        while (ar_headers->next != NULL) {
                if (strcmp(ar_headers->name, ar_filename)==0)
@@ -154,7 +154,7 @@ extern int dpkg_deb_main(int argc, char **argv)
                        mkdir(target_dir, 0755);
                }
                if (chdir(target_dir)==-1) {
-                       error_msg_and_die("Cannot change to dir %s\n",argv[optind+1]);
+                       error_msg_and_die("Cannot change to dir %s", argv[optind+1]);
                }
        }
        status = readTarFile(srcFd, extract_flag, list_flag, extract_to_stdout, verbose_flag, NULL, extract_list);
index b2067b30ca941b0e918423ae907e615c2a6896d3..4ab711e5507eb30b2e2829ac37480127688eba25 100644 (file)
@@ -81,7 +81,7 @@ int dumpkmap_main(int argc, char **argv)
                                ke.kb_table = i;
                                if (ioctl(fd, KDGKBENT, &ke) < 0) {
                                
-                                       error_msg("ioctl returned: %s, %s, %s, %xqq\n",strerror(errno),(char *)&ke.kb_index,(char *)&ke.kb_table,(int)&ke.kb_value);
+                                       error_msg("ioctl returned: %s, %s, %s, %xqq", strerror(errno),(char *)&ke.kb_index,(char *)&ke.kb_table,(int)&ke.kb_value);
                                        }
                                else {
                                        write(1,(void*)&ke.kb_value,2); 
index 73a9ad3ec23800392a7b1152df6e8fc03b277229..e0351c3b80f6ae3029b68a4450467728a26dbc4d 100644 (file)
@@ -169,7 +169,7 @@ static int get_address(struct sed_cmd *sed_cmd, const char *str, int *line, rege
        else if (my_str[idx] == '/') {
                idx = index_of_next_unescaped_regexp_delim(sed_cmd, my_str, ++idx);
                if (idx == -1)
-                       error_msg_and_die("unterminated match expression\n");
+                       error_msg_and_die("unterminated match expression");
                my_str[idx] = '\0';
                *regex = (regex_t *)xmalloc(sizeof(regex_t));
                xregcomp(*regex, my_str+1, 0);
@@ -177,7 +177,7 @@ static int get_address(struct sed_cmd *sed_cmd, const char *str, int *line, rege
        }
        else {
                error_msg("get_address: no address found in string\n"
-                               "\t(you probably didn't check the string you passed me)\n");
+                               "\t(you probably didn't check the string you passed me)");
                idx = -1;
        }
 
@@ -213,7 +213,7 @@ static int parse_subst_cmd(struct sed_cmd *sed_cmd, const char *substr)
        /* verify that the 's' is followed by something.  That something
         * (typically a 'slash') is now our regexp delimiter... */
        if (!substr[++idx])
-               error_msg_and_die("bad format in substitution expression\n");
+               error_msg_and_die("bad format in substitution expression");
        else
            sed_cmd->delimiter=substr[idx];
 
@@ -221,7 +221,7 @@ static int parse_subst_cmd(struct sed_cmd *sed_cmd, const char *substr)
        oldidx = idx+1;
        idx = index_of_next_unescaped_regexp_delim(sed_cmd, substr, ++idx);
        if (idx == -1)
-               error_msg_and_die("bad format in substitution expression\n");
+               error_msg_and_die("bad format in substitution expression");
        match = strdup_substr(substr, oldidx, idx);
 
        /* determine the number of back references in the match string */
@@ -240,7 +240,7 @@ static int parse_subst_cmd(struct sed_cmd *sed_cmd, const char *substr)
        oldidx = idx+1;
        idx = index_of_next_unescaped_regexp_delim(sed_cmd, substr, ++idx);
        if (idx == -1)
-               error_msg_and_die("bad format in substitution expression\n");
+               error_msg_and_die("bad format in substitution expression");
        sed_cmd->replace = strdup_substr(substr, oldidx, idx);
 
        /* process the flags */
@@ -260,7 +260,7 @@ static int parse_subst_cmd(struct sed_cmd *sed_cmd, const char *substr)
                                if (strchr("; \t\v\n\r", substr[idx]))
                                        goto out;
                                /* else */
-                               error_msg_and_die("bad option in substitution expression\n");
+                               error_msg_and_die("bad option in substitution expression");
                }
        }
 
@@ -302,7 +302,7 @@ static int parse_edit_cmd(struct sed_cmd *sed_cmd, const char *editstr)
         */
 
        if (editstr[1] != '\\' && (editstr[2] != '\n' || editstr[2] != '\r'))
-               error_msg_and_die("bad format in edit expression\n");
+               error_msg_and_die("bad format in edit expression");
 
        /* store the edit line text */
        /* make editline big enough to accomodate the extra '\n' we will tack on
@@ -366,9 +366,9 @@ static char *parse_cmd_str(struct sed_cmd *sed_cmd, const char *cmdstr)
 
        /* last part (mandatory) will be a command */
        if (cmdstr[idx] == '\0')
-               error_msg_and_die("missing command\n");
+               error_msg_and_die("missing command");
        if (!strchr("pdsaic", cmdstr[idx])) /* <-- XXX add new commands here */
-               error_msg_and_die("invalid command\n");
+               error_msg_and_die("invalid command");
        sed_cmd->cmd = cmdstr[idx];
 
        /* special-case handling for (s)ubstitution */
@@ -378,7 +378,7 @@ static char *parse_cmd_str(struct sed_cmd *sed_cmd, const char *cmdstr)
        /* special-case handling for (a)ppend, (i)nsert, and (c)hange */
        else if (strchr("aic", cmdstr[idx])) {
                if (sed_cmd->end_line || sed_cmd->end_match)
-                       error_msg_and_die("only a beginning address can be specified for edit commands\n");
+                       error_msg_and_die("only a beginning address can be specified for edit commands");
                idx += parse_edit_cmd(sed_cmd, &cmdstr[idx]);
        }
        /* if it was a single-letter command (such as 'p' or 'd') we need to
diff --git a/expr.c b/expr.c
index 71bd22417bd215d5406608ccebde304519455957..8ef5293c1d86771fd503ebb15a38964db00af984 100644 (file)
--- a/expr.c
+++ b/expr.c
@@ -76,14 +76,14 @@ int expr_main (int argc, char **argv)
        VALUE *v;
 
        if (argc == 1) {
-               error_msg_and_die("too few arguments\n");
+               error_msg_and_die("too few arguments");
        }
 
        args = argv + 1;
 
        v = eval ();
        if (*args)
-               error_msg_and_die ("syntax error\n");
+               error_msg_and_die ("syntax error");
 
        if (v->type == integer)
                printf ("%d\n", v->u.i);
@@ -218,7 +218,7 @@ static                                              \
 int name (l, r) VALUE *l; VALUE *r;            \
 {                                              \
   if (!toarith (l) || !toarith (r))            \
-    error_msg_and_die ("non-numeric argument\n");      \
+    error_msg_and_die ("non-numeric argument");        \
   return l->u.i op r->u.i;                     \
 }
 
@@ -226,9 +226,9 @@ int name (l, r) VALUE *l; VALUE *r;         \
 int name (l, r) VALUE *l; VALUE *r;            \
 {                                              \
   if (!toarith (l) || !toarith (r))            \
-    error_msg_and_die ( "non-numeric argument\n");     \
+    error_msg_and_die ( "non-numeric argument");       \
   if (r->u.i == 0)                             \
-    error_msg_and_die ( "division by zero\n");         \
+    error_msg_and_die ( "division by zero");           \
   return l->u.i op r->u.i;                     \
 }
 
@@ -272,7 +272,7 @@ of a basic regular expression is not portable; it is being ignored",
        re_syntax_options = RE_SYNTAX_POSIX_BASIC;
        errmsg = re_compile_pattern (pv->u.s, len, &re_buffer);
        if (errmsg) {
-               error_msg_and_die("%s\n", errmsg);
+               error_msg_and_die("%s", errmsg);
        }
 
        len = re_match (&re_buffer, sv->u.s, strlen (sv->u.s), 0, &re_regs);
@@ -303,19 +303,19 @@ static VALUE *eval7 (void)
        VALUE *v;
 
        if (!*args)
-               error_msg_and_die ( "syntax error\n");
+               error_msg_and_die ( "syntax error");
 
        if (nextarg ("(")) {
                args++;
                v = eval ();
                if (!nextarg (")"))
-                       error_msg_and_die ( "syntax error\n");
+                       error_msg_and_die ( "syntax error");
                        args++;
                        return v;
                }
 
        if (nextarg (")"))
-               error_msg_and_die ( "syntax error\n");
+               error_msg_and_die ( "syntax error");
 
        return str_value (*args++);
 }
@@ -329,7 +329,7 @@ static VALUE *eval6 (void)
        if (nextarg ("quote")) {
                args++;
                if (!*args)
-                       error_msg_and_die ( "syntax error\n");
+                       error_msg_and_die ( "syntax error");
                return str_value (*args++);
        }
        else if (nextarg ("length")) {
diff --git a/fbset.c b/fbset.c
index 637896bedc6970cbda45e1977f14aae52de3804c..f20c284aa3c1e5f9ce11e2c17efe662be2de9695 100644 (file)
--- a/fbset.c
+++ b/fbset.c
@@ -284,7 +284,7 @@ static int readmode(struct fb_var_screeninfo *base, const char *fn,
                }
        }
 #else
-       error_msg( "mode reading not compiled in\n");
+       error_msg( "mode reading not compiled in");
 #endif
        return 0;
 }
@@ -434,7 +434,7 @@ extern int fbset_main(int argc, char **argv)
                perror_msg_and_die("fbset(ioctl)");
        if (g_options & OPT_READMODE) {
                if (!readmode(&var, modefile, mode)) {
-                       error_msg("Unknown video mode `%s'\n", mode);
+                       error_msg("Unknown video mode `%s'", mode);
                        return EXIT_FAILURE;
                }
        }
index 18841ec563b6c9fa14fb2f2b58c1decbad8eff0e..9d762200606d243af355d4839fb24de99feeda6c 100644 (file)
@@ -290,7 +290,7 @@ static void show_usage(void)
 
 static void die(const char *str)
 {
-       error_msg("%s\n", str);
+       error_msg("%s", str);
        leave(8);
 }
 
index ff55a3e3ce23a6810522aca3f4f36edb7d7273e5..625263184321b25c510d8da57913b97fcc44e59a 100644 (file)
--- a/getopt.c
+++ b/getopt.c
@@ -258,7 +258,7 @@ void add_long_options(char *options)
                                         arg_opt=required_argument;
                                 }
                                 if (strlen(tokptr) == 0)
-                                        error_msg("empty long option after -l or --long argument\n");
+                                        error_msg("empty long option after -l or --long argument");
                         }
                         add_longopt(tokptr,arg_opt);
                 }
@@ -277,7 +277,7 @@ void set_shell(const char *new_shell)
         else if (!strcmp(new_shell,"csh"))
                 shell=TCSH;
         else
-                error_msg("unknown shell after -s or --shell argument\n");
+                error_msg("unknown shell after -s or --shell argument");
 }
 
 
@@ -326,7 +326,7 @@ int getopt_main(int argc, char *argv[])
                         printf(" --\n");
                         exit(0);
                 } else
-                        error_msg_and_die("missing optstring argument\n");
+                        error_msg_and_die("missing optstring argument");
         }
 
         if (argv[1][0] != '-' || compatible) {
@@ -377,7 +377,7 @@ int getopt_main(int argc, char *argv[])
 
         if (!optstr) {
                 if (optind >= argc)
-                        error_msg_and_die("missing optstring argument\n");
+                        error_msg_and_die("missing optstring argument");
                 else {
                         optstr=xmalloc(strlen(argv[optind])+1);
                         strcpy(optstr,argv[optind]);
index 09571f91c19694d9a792432f61522c8eb1701a12..48a46083b71895edad731c14373be9f41f8560d1 100644 (file)
--- a/gunzip.c
+++ b/gunzip.c
@@ -297,7 +297,7 @@ int in;                                     /* input file descriptor */
 
                method = (int) get_byte();
                if (method != DEFLATED) {
-                       error_msg("unknown method %d -- get newer version of gzip\n", method);
+                       error_msg("unknown method %d -- get newer version of gzip", method);
                        exit_code = ERROR;
                        return -1;
                }
@@ -1116,11 +1116,11 @@ int in, out;                                    /* input and output file descriptors */
                if (res == 3) {
                        error_msg(memory_exhausted);
                } else if (res != 0) {
-                       error_msg("invalid compressed data--format violated\n");
+                       error_msg("invalid compressed data--format violated");
                }
 
        } else {
-               error_msg("internal error, invalid method\n");
+               error_msg("internal error, invalid method");
        }
 
        /* Get the crc and original length */
@@ -1149,15 +1149,15 @@ int in, out;                                    /* input and output file descriptors */
 
        /* Validate decompression */
        if (orig_crc != updcrc(outbuf, 0)) {
-               error_msg("invalid compressed data--crc error\n");
+               error_msg("invalid compressed data--crc error");
        }
        if (orig_len != (ulg) bytes_out) {
-               error_msg("invalid compressed data--length error\n");
+               error_msg("invalid compressed data--length error");
        }
 
        /* Check if there are more entries in a pkzip file */
        if (pkzip && inptr + 4 < insize && LG(inbuf + inptr) == LOCSIG) {
-               fprintf(stderr, "has more than one entry--rest ignored\n");
+               error_msg("has more than one entry--rest ignored");
                if (exit_code == OK)
                        exit_code = WARNING;
        }
@@ -1261,9 +1261,9 @@ int gunzip_main(int argc, char **argv)
        }
 
        if (isatty(fileno(stdin)) && fromstdin==1 && force==0)
-               error_msg_and_die( "data not read from terminal. Use -f to force it.\n");
+               error_msg_and_die( "data not read from terminal. Use -f to force it.");
        if (isatty(fileno(stdout)) && tostdout==1 && force==0)
-               error_msg_and_die( "data not written to terminal. Use -f to force it.\n");
+               error_msg_and_die( "data not written to terminal. Use -f to force it.");
 
        gunzip_init();
 
diff --git a/gzip.c b/gzip.c
index 5a74868c19d4adec4ae458fad66d8e213f9458dd..75f3caa359c0e080a8d5648a930667a8711c25cf 100644 (file)
--- a/gzip.c
+++ b/gzip.c
@@ -1382,7 +1382,7 @@ int length;
                           (char *) window + start, length) != EQUAL) {
                fprintf(stderr,
                                " start %d, match %d, length %d\n", start, match, length);
-               error_msg("invalid match\n");
+               error_msg("invalid match");
        }
        if (verbose > 1) {
                fprintf(stderr, "\\[%d,%d]", start - match, length);
@@ -1822,9 +1822,9 @@ int gzip_main(int argc, char **argv)
        }
 
        if (isatty(fileno(stdin)) && fromstdin==1 && force==0)
-               error_msg_and_die( "data not read from terminal. Use -f to force it.\n");
+               error_msg_and_die( "data not read from terminal. Use -f to force it.");
        if (isatty(fileno(stdout)) && tostdout==1 && force==0)
-               error_msg_and_die( "data not written to terminal. Use -f to force it.\n");
+               error_msg_and_die( "data not written to terminal. Use -f to force it.");
 
        foreground = signal(SIGINT, SIG_IGN) != SIG_IGN;
        if (foreground) {
@@ -2894,7 +2894,7 @@ int eof;                                          /* true if this is the last block for a file */
 #endif
                /* Since LIT_BUFSIZE <= 2*WSIZE, the input data must be there: */
                if (buf == (char *) 0)
-                       error_msg("block vanished\n");
+                       error_msg("block vanished");
 
                copy_block(buf, (unsigned) stored_len, 0);      /* without header */
                compressed_len = stored_len << 3;
@@ -3077,7 +3077,7 @@ local void set_file_type()
                bin_freq += dyn_ltree[n++].Freq;
        *file_type = bin_freq > (ascii_freq >> 2) ? BINARY : ASCII;
        if (*file_type == BINARY && translate_eol) {
-               error_msg("-l used on binary file\n");
+               error_msg("-l used on binary file");
        }
 }
 
@@ -3239,7 +3239,7 @@ char *env;                                                /* name of environment variable */
 
        /* Copy the program name first */
        if (oargc-- < 0)
-               error_msg("argc<=0\n");
+               error_msg("argc<=0");
        *(nargv++) = *(oargv++);
 
        /* Then copy the environment args */
index a789fa0f15d9a787691ae286db52f38bf3b3e63b..3dba641540e2c8da76c6fedfae5e189a7ed7a9a6 100644 (file)
@@ -1,6 +1,6 @@
 /* vi: set sw=4 ts=4: */
 /*
- * $Id: hostname.c,v 1.21 2001/01/27 08:24:37 andersen Exp $
+ * $Id: hostname.c,v 1.22 2001/01/31 19:00:20 kraai Exp $
  * Mini hostname implementation for busybox
  *
  * Copyright (C) 1999 by Randolph Chung <tausq@debian.org>
@@ -41,7 +41,7 @@ void do_sethostname(char *s, int isfile)
        if (!isfile) {
                if (sethostname(s, strlen(s)) < 0) {
                        if (errno == EPERM)
-                               error_msg_and_die("you must be root to change the hostname\n");
+                               error_msg_and_die("you must be root to change the hostname");
                        else
                                perror_msg_and_die("sethostname");
                }
diff --git a/id.c b/id.c
index e91ac758570e7b3e4ef9ef042611507bb65d068e..650e3db20c8323138ae986e2f486917602f459ed 100644 (file)
--- a/id.c
+++ b/id.c
@@ -77,7 +77,7 @@ extern int id_main(int argc, char **argv)
        pwnam=my_getpwnam(user);
        grnam=my_getgrnam(group);
        if (gid == -1 || pwnam==-1 || grnam==-1) {
-               error_msg_and_die("%s: No such user\n", user);
+               error_msg_and_die("%s: No such user", user);
        }
 
        if (no_group) {
index 57a152c013f8ae0ef7c7a36d974ae5cfc6fdf0ac..e55d9fafb115ec5748a8799ae276795a2f3ed162 100644 (file)
--- a/insmod.c
+++ b/insmod.c
@@ -81,7 +81,7 @@
 #ifndef MODUTILS_MODULE_H
 static const int MODUTILS_MODULE_H = 1;
 
-#ident "$Id: insmod.c,v 1.44 2001/01/27 09:33:38 andersen Exp $"
+#ident "$Id: insmod.c,v 1.45 2001/01/31 19:00:21 kraai Exp $"
 
 /* This file contains the structures used by the 2.0 and 2.1 kernels.
    We do not use the kernel headers directly because we do not wish
@@ -287,7 +287,7 @@ int delete_module(const char *);
 #ifndef MODUTILS_OBJ_H
 static const int MODUTILS_OBJ_H = 1;
 
-#ident "$Id: insmod.c,v 1.44 2001/01/27 09:33:38 andersen Exp $"
+#ident "$Id: insmod.c,v 1.45 2001/01/31 19:00:21 kraai Exp $"
 
 /* The relocatable object is manipulated using elfin types.  */
 
@@ -1156,7 +1156,7 @@ struct obj_symbol *obj_add_symbol(struct obj_file *f, const char *name,
                                /* Don't report an error if the symbol is coming from
                                   the kernel or some external module.  */
                                if (secidx <= SHN_HIRESERVE)
-                                       error_msg("%s multiply defined\n", name);
+                                       error_msg("%s multiply defined", name);
                                return sym;
                        }
                }
@@ -1419,7 +1419,7 @@ old_process_module_arguments(struct obj_file *f, int argc, char **argv)
 
                /* Also check that the parameter was not resolved from the kernel.  */
                if (sym == NULL || sym->secidx > SHN_HIRESERVE) {
-                       error_msg("symbol for parameter %s not found\n", p);
+                       error_msg("symbol for parameter %s not found", p);
                        return 0;
                }
 
@@ -1432,7 +1432,7 @@ old_process_module_arguments(struct obj_file *f, int argc, char **argv)
                        str = alloca(strlen(q));
                        for (r = str, q++; *q != '"'; ++q, ++r) {
                                if (*q == '\0') {
-                                       error_msg("improperly terminated string argument for %s\n", p);
+                                       error_msg("improperly terminated string argument for %s", p);
                                        return 0;
                                } else if (*q == '\\')
                                        switch (*++q) {
@@ -1786,7 +1786,7 @@ new_process_module_arguments(struct obj_file *f, int argc, char **argv)
                p = get_modinfo_value(f, key);
                key += 5;
                if (p == NULL) {
-                       error_msg("invalid parameter %s\n", key);
+                       error_msg("invalid parameter %s", key);
                        return 0;
                }
 
@@ -1794,7 +1794,7 @@ new_process_module_arguments(struct obj_file *f, int argc, char **argv)
 
                /* Also check that the parameter was not resolved from the kernel.  */
                if (sym == NULL || sym->secidx > SHN_HIRESERVE) {
-                       error_msg("symbol for parameter %s not found\n", key);
+                       error_msg("symbol for parameter %s not found", key);
                        return 0;
                }
 
@@ -1822,7 +1822,7 @@ new_process_module_arguments(struct obj_file *f, int argc, char **argv)
                                        str = alloca(strlen(q));
                                        for (r = str, q++; *q != '"'; ++q, ++r) {
                                                if (*q == '\0') {
-                                                       error_msg("improperly terminated string argument for %s\n",
+                                                       error_msg("improperly terminated string argument for %s",
                                                                        key);
                                                        return 0;
                                                } else if (*q == '\\')
@@ -1917,14 +1917,14 @@ new_process_module_arguments(struct obj_file *f, int argc, char **argv)
                                        /* Probably we should do that outside the loop ? */
                                        if (!isdigit(*(p + 1))) {
                                                error_msg("parameter type 'c' for %s must be followed by"
-                                                               " the maximum size\n", key);
+                                                               " the maximum size", key);
                                                return 0;
                                        }
                                        charssize = strtoul(p + 1, (char **) NULL, 10);
 
                                        /* Check length */
                                        if (strlen(str) >= charssize) {
-                                               error_msg("string too long for %s (max %ld)\n", key,
+                                               error_msg("string too long for %s (max %ld)", key,
                                                                charssize - 1);
                                                return 0;
                                        }
@@ -1953,7 +1953,7 @@ new_process_module_arguments(struct obj_file *f, int argc, char **argv)
                                        break;
 
                                default:
-                                       error_msg("unknown parameter type '%c' for %s\n", *p, key);
+                                       error_msg("unknown parameter type '%c' for %s", *p, key);
                                        return 0;
                                }
                        }
@@ -1972,21 +1972,21 @@ new_process_module_arguments(struct obj_file *f, int argc, char **argv)
 
                        case ',':
                                if (++n > max) {
-                                       error_msg("too many values for %s (max %d)\n", key, max);
+                                       error_msg("too many values for %s (max %d)", key, max);
                                        return 0;
                                }
                                ++q;
                                break;
 
                        default:
-                               error_msg("invalid argument syntax for %s\n", key);
+                               error_msg("invalid argument syntax for %s", key);
                                return 0;
                        }
                }
 
          end_of_arg:
                if (n < min) {
-                       error_msg("too few values for %s (min %d)\n", key, min);
+                       error_msg("too few values for %s (min %d)", key, min);
                        return 0;
                }
 
@@ -2372,7 +2372,7 @@ int obj_check_undefineds(struct obj_file *f)
                                        sym->secidx = SHN_ABS;
                                        sym->value = 0;
                                } else {
-                                       error_msg("unresolved symbol %s\n", sym->name);
+                                       error_msg("unresolved symbol %s", sym->name);
                                        ret = 0;
                                }
                        }
@@ -2599,11 +2599,11 @@ int obj_relocate(struct obj_file *f, ElfW(Addr) base)
                                errmsg = "Unhandled relocation";
                          bad_reloc:
                                if (extsym) {
-                                       error_msg("%s of type %ld for %s\n", errmsg,
+                                       error_msg("%s of type %ld for %s", errmsg,
                                                        (long) ELFW(R_TYPE) (rel->r_info),
                                                        strtab + extsym->st_name);
                                } else {
-                                       error_msg("%s of type %ld\n", errmsg,
+                                       error_msg("%s of type %ld", errmsg,
                                                        (long) ELFW(R_TYPE) (rel->r_info));
                                }
                                ret = 0;
@@ -2688,25 +2688,25 @@ struct obj_file *obj_load(FILE * fp)
                || f->header.e_ident[EI_MAG1] != ELFMAG1
                || f->header.e_ident[EI_MAG2] != ELFMAG2
                || f->header.e_ident[EI_MAG3] != ELFMAG3) {
-               error_msg("not an ELF file\n");
+               error_msg("not an ELF file");
                return NULL;
        }
        if (f->header.e_ident[EI_CLASS] != ELFCLASSM
                || f->header.e_ident[EI_DATA] != ELFDATAM
                || f->header.e_ident[EI_VERSION] != EV_CURRENT
                || !MATCH_MACHINE(f->header.e_machine)) {
-               error_msg("ELF file not for this architecture\n");
+               error_msg("ELF file not for this architecture");
                return NULL;
        }
        if (f->header.e_type != ET_REL) {
-               error_msg("ELF file not a relocatable object\n");
+               error_msg("ELF file not a relocatable object");
                return NULL;
        }
 
        /* Read the section headers.  */
 
        if (f->header.e_shentsize != sizeof(ElfW(Shdr))) {
-               error_msg("section header size mismatch: %lu != %lu\n",
+               error_msg("section header size mismatch: %lu != %lu",
                                (unsigned long) f->header.e_shentsize,
                                (unsigned long) sizeof(ElfW(Shdr)));
                return NULL;
@@ -2759,11 +2759,11 @@ struct obj_file *obj_load(FILE * fp)
 
 #if SHT_RELM == SHT_REL
                case SHT_RELA:
-                       error_msg("RELA relocations not supported on this architecture\n");
+                       error_msg("RELA relocations not supported on this architecture");
                        return NULL;
 #else
                case SHT_REL:
-                       error_msg("REL relocations not supported on this architecture\n");
+                       error_msg("REL relocations not supported on this architecture");
                        return NULL;
 #endif
 
@@ -2776,7 +2776,7 @@ struct obj_file *obj_load(FILE * fp)
                                break;
                        }
 
-                       error_msg("can't handle sections of type %ld\n",
+                       error_msg("can't handle sections of type %ld",
                                        (long) sec->header.sh_type);
                        return NULL;
                }
@@ -2805,7 +2805,7 @@ struct obj_file *obj_load(FILE * fp)
                                ElfW(Sym) * sym;
 
                                if (sec->header.sh_entsize != sizeof(ElfW(Sym))) {
-                                       error_msg("symbol size mismatch: %lu != %lu\n",
+                                       error_msg("symbol size mismatch: %lu != %lu",
                                                        (unsigned long) sec->header.sh_entsize,
                                                        (unsigned long) sizeof(ElfW(Sym)));
                                        return NULL;
@@ -2837,7 +2837,7 @@ struct obj_file *obj_load(FILE * fp)
 
                case SHT_RELM:
                        if (sec->header.sh_entsize != sizeof(ElfW(RelM))) {
-                               error_msg("relocation entry size mismatch: %lu != %lu\n",
+                               error_msg("relocation entry size mismatch: %lu != %lu",
                                                (unsigned long) sec->header.sh_entsize,
                                                (unsigned long) sizeof(ElfW(RelM)));
                                return NULL;
@@ -2949,11 +2949,11 @@ extern int insmod_main( int argc, char **argv)
                        if (m_filename[0] == '\0'
                                || ((fp = fopen(m_filename, "r")) == NULL)) 
                        {
-                               error_msg("No module named '%s' found in '%s'\n", m_fullName, _PATH_MODULES);
+                               error_msg("No module named '%s' found in '%s'", m_fullName, _PATH_MODULES);
                                return EXIT_FAILURE;
                        }
                } else
-                       error_msg_and_die("No module named '%s' found in '%s'\n", m_fullName, _PATH_MODULES);
+                       error_msg_and_die("No module named '%s' found in '%s'", m_fullName, _PATH_MODULES);
        } else
                memcpy(m_filename, argv[optind], strlen(argv[optind]));
 
@@ -2976,7 +2976,7 @@ extern int insmod_main( int argc, char **argv)
                m_version = old_get_module_version(f, m_strversion);
                if (m_version == -1) {
                        error_msg("couldn't find the kernel version the module was "
-                                       "compiled for\n");
+                                       "compiled for");
                        goto out;
                }
        }
@@ -2985,12 +2985,12 @@ extern int insmod_main( int argc, char **argv)
                if (flag_force_load) {
                        error_msg("Warning: kernel-module version mismatch\n"
                                        "\t%s was compiled for kernel version %s\n"
-                                       "\twhile this kernel is version %s\n",
+                                       "\twhile this kernel is version %s",
                                        m_filename, m_strversion, k_strversion);
                } else {
                        error_msg("kernel-module version mismatch\n"
                                        "\t%s was compiled for kernel version %s\n"
-                                       "\twhile this kernel is version %s.\n",
+                                       "\twhile this kernel is version %s.",
                                        m_filename, m_strversion, k_strversion);
                        goto out;
                }
@@ -3006,7 +3006,7 @@ extern int insmod_main( int argc, char **argv)
                        goto out;
                k_crcs = new_is_kernel_checksummed();
 #else
-               error_msg("Not configured to support new kernels\n");
+               error_msg("Not configured to support new kernels");
                goto out;
 #endif
        } else {
@@ -3015,7 +3015,7 @@ extern int insmod_main( int argc, char **argv)
                        goto out;
                k_crcs = old_is_kernel_checksummed();
 #else
-               error_msg("Not configured to support old kernels\n");
+               error_msg("Not configured to support old kernels");
                goto out;
 #endif
        }
@@ -3072,10 +3072,10 @@ extern int insmod_main( int argc, char **argv)
        m_addr = create_module(m_name, m_size);
        if (m_addr==-1) switch (errno) {
        case EEXIST:
-               error_msg("A module named %s already exists\n", m_name);
+               error_msg("A module named %s already exists", m_name);
                goto out;
        case ENOMEM:
-               error_msg("Can't allocate kernel memory for module; needed %lu bytes\n",
+               error_msg("Can't allocate kernel memory for module; needed %lu bytes",
                                m_size);
                goto out;
        default:
diff --git a/kill.c b/kill.c
index 3eb829abf41372ebc86ba6bc55ed42242fd59bf5..00a4d5c402c612b1c1cf9f555caa80b19b9433c0 100644 (file)
--- a/kill.c
+++ b/kill.c
@@ -223,7 +223,7 @@ extern int kill_main(int argc, char **argv)
                        pidList = find_pid_by_name( *argv);
                        if (!pidList) {
                                all_found = FALSE;
-                               error_msg( "%s: no process killed\n", *argv);
+                               error_msg( "%s: no process killed", *argv);
                        }
 
                        for(; pidList && *pidList!=0; pidList++) {
@@ -246,5 +246,5 @@ extern int kill_main(int argc, char **argv)
 
 
   end:
-       error_msg_and_die( "bad signal name: %s\n", *argv);
+       error_msg_and_die( "bad signal name: %s", *argv);
 }
diff --git a/lash.c b/lash.c
index b3bdcc986a41648ed73c7812133cf5cfa2bc8a49..cc0d78687fdd301c4bc06ced330a9211ea2646c8 100644 (file)
--- a/lash.c
+++ b/lash.c
@@ -321,13 +321,13 @@ static int builtin_fg_bg(struct child_prog *child)
        struct job *job=NULL;
        
        if (!child->argv[1] || child->argv[2]) {
-               error_msg("%s: exactly one argument is expected\n",
+               error_msg("%s: exactly one argument is expected",
                                child->argv[0]);
                return EXIT_FAILURE;
        }
 
        if (sscanf(child->argv[1], "%%%d", &jobNum) != 1) {
-               error_msg("%s: bad argument '%s'\n",
+               error_msg("%s: bad argument '%s'",
                                child->argv[0], child->argv[1]);
                return EXIT_FAILURE;
        }
@@ -339,7 +339,7 @@ static int builtin_fg_bg(struct child_prog *child)
        }
 
        if (!job) {
-               error_msg("%s: unknown job %d\n",
+               error_msg("%s: unknown job %d",
                                child->argv[0], jobNum);
                return EXIT_FAILURE;
        }
@@ -492,7 +492,7 @@ static int builtin_then(struct child_prog *child)
        debug_printf( "job=%p entering builtin_then ('%s')-- context=%d\n", cmd, charptr1, cmd->job_context);
        if (! (cmd->job_context & (IF_TRUE_CONTEXT|IF_FALSE_CONTEXT))) {
                shell_context = 0; /* Reset the shell's context on an error */
-               error_msg("%s `then'\n", syntax_err);
+               error_msg("%s `then'", syntax_err);
                return EXIT_FAILURE;
        }
 
@@ -520,7 +520,7 @@ static int builtin_else(struct child_prog *child)
 
        if (! (cmd->job_context & THEN_EXP_CONTEXT)) {
                shell_context = 0; /* Reset the shell's context on an error */
-               error_msg("%s `else'\n", syntax_err);
+               error_msg("%s `else'", syntax_err);
                return EXIT_FAILURE;
        }
        /* If the if result was TRUE, skip the 'else' stuff */
@@ -543,7 +543,7 @@ static int builtin_fi(struct child_prog *child)
        debug_printf( "job=%p entering builtin_fi ('%s')-- context=%d\n", cmd, "", cmd->job_context);
        if (! (cmd->job_context & (IF_TRUE_CONTEXT|IF_FALSE_CONTEXT))) {
                shell_context = 0; /* Reset the shell's context on an error */
-               error_msg("%s `fi'\n", syntax_err);
+               error_msg("%s `fi'", syntax_err);
                return EXIT_FAILURE;
        }
        /* Clear out the if and then context bits */
@@ -748,7 +748,7 @@ static int setup_redirects(struct child_prog *prog, int squirrel[])
                if (openfd < 0) {
                        /* this could get lost if stderr has been redirected, but
                           bash and ash both lose it as well (though zsh doesn't!) */
-                       error_msg("error opening %s: %s\n", redir->filename,
+                       error_msg("error opening %s: %s", redir->filename,
                                        strerror(errno));
                        return 1;
                }
@@ -960,7 +960,7 @@ static void expand_argument(struct child_prog *prog, int *argcPtr,
        if (strpbrk(prog->argv[argc_l - 1],"*[]?")!= NULL){
                rc = glob(prog->argv[argc_l - 1], flags, NULL, &prog->glob_result);
                if (rc == GLOB_NOSPACE) {
-                       error_msg("out of space during glob operation\n");
+                       error_msg("out of space during glob operation");
                        return;
                } else if (rc == GLOB_NOMATCH ||
                           (!rc && (prog->glob_result.gl_pathc - i) == 1 &&
@@ -1068,7 +1068,7 @@ static int parse_command(char **command_ptr, struct job *job, int *inbg)
                        if (*src == '\\') {
                                src++;
                                if (!*src) {
-                                       error_msg("character expected after \\\n");
+                                       error_msg("character expected after \\");
                                        free_job(job);
                                        return 1;
                                }
@@ -1152,7 +1152,7 @@ static int parse_command(char **command_ptr, struct job *job, int *inbg)
                                        chptr++;
 
                                if (!*chptr) {
-                                       error_msg("file name expected after %c\n", *src);
+                                       error_msg("file name expected after %c", *src);
                                        free_job(job);
                                        job->num_progs=0;
                                        return 1;
@@ -1171,7 +1171,7 @@ static int parse_command(char **command_ptr, struct job *job, int *inbg)
                                if (*prog->argv[argc_l])
                                        argc_l++;
                                if (!argc_l) {
-                                       error_msg("empty command in pipe\n");
+                                       error_msg("empty command in pipe");
                                        free_job(job);
                                        job->num_progs=0;
                                        return 1;
@@ -1199,7 +1199,7 @@ static int parse_command(char **command_ptr, struct job *job, int *inbg)
                                        src++;
 
                                if (!*src) {
-                                       error_msg("empty command in pipe\n");
+                                       error_msg("empty command in pipe");
                                        free_job(job);
                                        job->num_progs=0;
                                        return 1;
@@ -1307,7 +1307,7 @@ static int parse_command(char **command_ptr, struct job *job, int *inbg)
                                        printf("erik: found a continue char at EOL...\n");
                                        command = (char *) xcalloc(BUFSIZ, sizeof(char));
                                        if (get_command(input, command)) {
-                                               error_msg("character expected after \\\n");
+                                               error_msg("character expected after \\");
                                                free(command);
                                                free_job(job);
                                                return 1;
@@ -1323,7 +1323,7 @@ static int parse_command(char **command_ptr, struct job *job, int *inbg)
                                        free(command);
                                        break;
 #else
-                                       error_msg("character expected after \\\n");
+                                       error_msg("character expected after \\");
                                        free(command);
                                        free_job(job);
                                        return 1;
@@ -1738,7 +1738,7 @@ int shell_main(int argc_l, char **argv_l)
                        case 'c':
                                input = NULL;
                                if (local_pending_command != 0)
-                                       error_msg_and_die("multiple -c arguments\n");
+                                       error_msg_and_die("multiple -c arguments");
                                local_pending_command = xstrdup(argv[optind]);
                                optind++;
                                argv = argv+optind;
index 040062cf8ce69140343d67302a4f285a9ee92b8e..345a2773cf147db374cf375f6413201d5afd67e1 100644 (file)
--- a/loadacm.c
+++ b/loadacm.c
@@ -70,7 +70,7 @@ int screen_map_load(int fd, FILE * fp)
                if (parse_failed) {
                        if (-1 == fseek(fp, 0, SEEK_SET)) {
                                if (errno == ESPIPE)
-                                       error_msg_and_die("16bit screen-map MUST be a regular file.\n");
+                                       error_msg_and_die("16bit screen-map MUST be a regular file.");
                                else
                                        perror_msg_and_die("fseek failed reading binary 16bit screen-map");
                        }
@@ -79,7 +79,7 @@ int screen_map_load(int fd, FILE * fp)
                                perror_msg_and_die("Cannot read [new] map from file");
 #if 0
                        else
-                               error_msg("Input screen-map is binary.\n");
+                               error_msg("Input screen-map is binary.");
 #endif
                }
 
@@ -96,7 +96,7 @@ int screen_map_load(int fd, FILE * fp)
        /* rewind... */
        if (-1 == fseek(fp, 0, SEEK_SET)) {
                if (errno == ESPIPE)
-                       error_msg("Assuming 8bit screen-map - MUST be a regular file.\n"),
+                       error_msg("Assuming 8bit screen-map - MUST be a regular file."),
                                exit(1);
                else
                        perror_msg_and_die("fseek failed assuming 8bit screen-map");
@@ -109,7 +109,7 @@ int screen_map_load(int fd, FILE * fp)
                        if (-1 == fseek(fp, 0, SEEK_SET)) {
                                if (errno == ESPIPE)
                                        /* should not - it succedeed above */
-                                       error_msg_and_die("fseek() returned ESPIPE !\n");
+                                       error_msg_and_die("fseek() returned ESPIPE !");
                                else
                                        perror_msg_and_die("fseek for binary 8bit screen-map");
                        }
@@ -118,7 +118,7 @@ int screen_map_load(int fd, FILE * fp)
                                perror_msg_and_die("Cannot read [old] map from file");
 #if 0
                        else
-                               error_msg("Input screen-map is binary.\n");
+                               error_msg("Input screen-map is binary.");
 #endif
                }
 
@@ -127,7 +127,7 @@ int screen_map_load(int fd, FILE * fp)
                else
                        return 0;
        }
-       error_msg("Error parsing symbolic map\n");
+       error_msg("Error parsing symbolic map");
        return(1);
 }
 
index 08e07618e4660a052519c053a168e79172801976..ec3e50560777e298233e535200fd5ff54f2d9a00 100644 (file)
@@ -62,7 +62,7 @@ static void do_loadfont(int fd, char *inbuf, int unit, int fontsize)
        memset(buf, 0, sizeof(buf));
 
        if (unit < 1 || unit > 32)
-               error_msg_and_die("Bad character size %d\n", unit);
+               error_msg_and_die("Bad character size %d", unit);
 
        for (i = 0; i < fontsize; i++)
                memcpy(buf + (32 * i), inbuf + (unit * i), unit);
@@ -119,8 +119,8 @@ do_loadtable(int fd, unsigned char *inbuf, int tailsz, int fontsize)
        if (ioctl(fd, PIO_UNIMAPCLR, &advice)) {
 #ifdef ENOIOCTLCMD
                if (errno == ENOIOCTLCMD) {
-                       error_msg("It seems this kernel is older than 1.1.92\n");
-                       error_msg_and_die("No Unicode mapping table loaded.\n");
+                       error_msg("It seems this kernel is older than 1.1.92");
+                       error_msg_and_die("No Unicode mapping table loaded.");
                } else
 #endif
                        perror_msg_and_die("PIO_UNIMAPCLR");
@@ -174,11 +174,11 @@ static void loadnewfont(int fd)
                        goto no_psf;
 
                if (psfhdr.mode > PSF_MAXMODE)
-                       error_msg_and_die("Unsupported psf file mode\n");
+                       error_msg_and_die("Unsupported psf file mode");
                fontsize = ((psfhdr.mode & PSF_MODE512) ? 512 : 256);
 #if !defined( PIO_FONTX ) || defined( __sparc__ )
                if (fontsize != 256)
-                       error_msg_and_die("Only fontsize 256 supported\n");
+                       error_msg_and_die("Only fontsize 256 supported");
 #endif
                hastable = (psfhdr.mode & PSF_MODEHASTAB);
                unit = psfhdr.charsize;
@@ -186,7 +186,7 @@ static void loadnewfont(int fd)
 
                head = head0 + fontsize * unit;
                if (head > inputlth || (!hastable && head != inputlth))
-                       error_msg_and_die("Input file: bad length\n");
+                       error_msg_and_die("Input file: bad length");
                do_loadfont(fd, inbuf + head0, unit, fontsize);
                if (hastable)
                        do_loadtable(fd, inbuf + head, inputlth - head, fontsize);
@@ -201,7 +201,7 @@ static void loadnewfont(int fd)
        } else {
                /* bare font */
                if (inputlth & 0377)
-                       error_msg_and_die("Bad input file size\n");
+                       error_msg_and_die("Bad input file size");
                offset = 0;
                unit = inputlth / 256;
        }
index 75b40da9aa672ac18f38946c9ca05b13799b2459..a98601aec9c2dff53be8c458d9b1170e5f68f886 100644 (file)
@@ -59,7 +59,7 @@ int loadkmap_main(int argc, char **argv)
 
        read(0, buff, 7);
        if (0 != strncmp(buff, BINARY_KEYMAP_MAGIC, 7))
-               error_msg_and_die("This is not a valid binary keymap.\n");
+               error_msg_and_die("This is not a valid binary keymap.");
 
        if (MAX_NR_KEYMAPS != read(0, flags, MAX_NR_KEYMAPS))
                perror_msg_and_die("Error reading keymap flags");
index 1ab868d75f86cd7934fb768ddd009259b21c9c2a..85c63b8a5a13a57306fccdc53225204c27b68329 100644 (file)
--- a/logger.c
+++ b/logger.c
@@ -87,14 +87,14 @@ static int pencode(char *s)
                *s = '\0';
                fac = decode(save, facilitynames);
                if (fac < 0)
-                       error_msg_and_die("unknown facility name: %s\n", save);
+                       error_msg_and_die("unknown facility name: %s", save);
                *s++ = '.';
        } else {
                s = save;
        }
        lev = decode(s, prioritynames);
        if (lev < 0)
-               error_msg_and_die("unknown priority name: %s\n", save);
+               error_msg_and_die("unknown priority name: %s", save);
        return ((lev & LOG_PRIMASK) | (fac & LOG_FACMASK));
 }
 
index edec016e67a4e9077e2a1749066f632614bba311..d9056c69da364cf37deb593b0eadd2896eaf2483 100644 (file)
--- a/logname.c
+++ b/logname.c
@@ -37,5 +37,5 @@ extern int logname_main(int argc, char **argv)
                puts(user);
                return EXIT_SUCCESS;
        }
-       error_msg_and_die("no login name\n");
+       error_msg_and_die("no login name");
 }
index ad4078040138da8e9dfd2587f0e8da5340dc27f3..97a940059ed98088bba393274ea44431542f17e0 100644 (file)
--- a/md5sum.c
+++ b/md5sum.c
@@ -719,7 +719,7 @@ static int md5_check(const char *checkfile_name)
     if (split_3(line, line_length, &md5num, &binary, &filename)
         || !hex_digits(md5num)) {
       if (warn) {
-        error_msg("%s: %lu: improperly formatted MD5 checksum line\n",
+        error_msg("%s: %lu: improperly formatted MD5 checksum line",
                  checkfile_name, (unsigned long) line_number);
       }
     } else {
@@ -764,7 +764,7 @@ static int md5_check(const char *checkfile_name)
   while (!feof(checkfile_stream) && !ferror(checkfile_stream));
 
   if (ferror(checkfile_stream)) {
-    error_msg("%s: read error\n", checkfile_name); /* */
+    error_msg("%s: read error", checkfile_name);
     return FALSE;
   }
 
@@ -775,7 +775,7 @@ static int md5_check(const char *checkfile_name)
 
   if (n_properly_formated_lines == 0) {
     /* Warn if no tests are found.  */
-    error_msg("%s: no properly formatted MD5 checksum lines found\n",
+    error_msg("%s: no properly formatted MD5 checksum lines found",
              checkfile_name);
     return FALSE;
   } else {
@@ -784,13 +784,13 @@ static int md5_check(const char *checkfile_name)
                                  - n_open_or_read_failures);
 
       if (n_open_or_read_failures > 0) {
-        error_msg("WARNING: %d of %d listed files could not be read\n",
+        error_msg("WARNING: %d of %d listed files could not be read",
                  n_open_or_read_failures, n_properly_formated_lines);
         return FALSE;
       }
 
       if (n_mismatched_checksums > 0) {
-        error_msg("WARNING: %d of %d computed checksums did NOT match\n",
+        error_msg("WARNING: %d of %d computed checksums did NOT match",
                  n_mismatched_checksums, n_computed_checkums);
         return FALSE;
       }
@@ -855,26 +855,26 @@ int md5sum_main(int argc,
   }
 
   if (file_type_specified && do_check) {
-    error_msg_and_die("the -b and -t options are meaningless when verifying checksums\n");
+    error_msg_and_die("the -b and -t options are meaningless when verifying checksums");
   }
 
   if (n_strings > 0 && do_check) {
-    error_msg_and_die("the -g and -c options are mutually exclusive\n");
+    error_msg_and_die("the -g and -c options are mutually exclusive");
   }
 
   if (status_only && !do_check) {
-    error_msg_and_die("the -s option is meaningful only when verifying checksums\n");
+    error_msg_and_die("the -s option is meaningful only when verifying checksums");
   }
 
   if (warn && !do_check) {
-    error_msg_and_die("the -w option is meaningful only when verifying checksums\n");
+    error_msg_and_die("the -w option is meaningful only when verifying checksums");
   }
 
   if (n_strings > 0) {
     size_t i;
 
     if (optind < argc) {
-      error_msg_and_die("no files may be specified when using -g\n");
+      error_msg_and_die("no files may be specified when using -g");
     }
     for (i = 0; i < n_strings; ++i) {
       size_t cnt;
@@ -887,7 +887,7 @@ int md5sum_main(int argc,
     }
   } else if (do_check) {
     if (optind + 1 < argc) {
-      error_msg("only one argument may be specified when using -c\n");
+      error_msg("only one argument may be specified when using -c");
     }
 
     err = md5_check ((optind == argc) ? "-" : argv[optind]);
@@ -940,11 +940,11 @@ int md5sum_main(int argc,
   }
 
   if (fclose (stdout) == EOF) {
-    error_msg_and_die("write error\n");
+    error_msg_and_die("write error");
   }
 
   if (have_read_stdin && fclose (stdin) == EOF) {
-    error_msg_and_die("standard input\n");
+    error_msg_and_die("standard input");
   }
 
   if (err == 0)
index c06a87f01cf4853f766cdeab767be3b532513057..d9a134281e6bc47764d2c5008dd3b9438faf6a8a 100644 (file)
         "BusyBox v" BB_VER " (" BB_BT ") multi-call binary -- GPL2")
 #endif
 #if defined bb_need_name_too_long || ! defined BB_DECLARE_EXTERN
-       BB_DEF_MESSAGE(name_too_long, "file name too long\n")
+       BB_DEF_MESSAGE(name_too_long, "file name too long")
 #endif
 #if defined bb_need_omitting_directory || ! defined BB_DECLARE_EXTERN
-       BB_DEF_MESSAGE(omitting_directory, "%s: omitting directory\n")
+       BB_DEF_MESSAGE(omitting_directory, "%s: omitting directory")
 #endif
 #if defined bb_need_not_a_directory || ! defined BB_DECLARE_EXTERN
-       BB_DEF_MESSAGE(not_a_directory, "%s: not a directory\n")
+       BB_DEF_MESSAGE(not_a_directory, "%s: not a directory")
 #endif
 #if defined bb_need_memory_exhausted || ! defined BB_DECLARE_EXTERN
-       BB_DEF_MESSAGE(memory_exhausted, "memory exhausted\n")
+       BB_DEF_MESSAGE(memory_exhausted, "memory exhausted")
 #endif
 #if defined bb_need_invalid_date || ! defined BB_DECLARE_EXTERN
-       BB_DEF_MESSAGE(invalid_date, "invalid date `%s'\n")
+       BB_DEF_MESSAGE(invalid_date, "invalid date `%s'")
 #endif
 #if defined bb_need_invalid_option || ! defined BB_DECLARE_EXTERN
-       BB_DEF_MESSAGE(invalid_option, "invalid option -- %c\n")
+       BB_DEF_MESSAGE(invalid_option, "invalid option -- %c")
 #endif
 #if defined bb_need_io_error || ! defined BB_DECLARE_EXTERN
-       BB_DEF_MESSAGE(io_error, "%s: input/output error -- %s\n")
+       BB_DEF_MESSAGE(io_error, "%s: input/output error -- %s")
 #endif
 #if defined bb_need_help || ! defined BB_DECLARE_EXTERN
        BB_DEF_MESSAGE(dash_dash_help, "--help")
 #endif
 #if defined bb_need_write_error || ! defined BB_DECLARE_EXTERN
-       BB_DEF_MESSAGE(write_error, "Write Error\n")
+       BB_DEF_MESSAGE(write_error, "Write Error")
 #endif
 #if defined bb_need_too_few_args || ! defined BB_DECLARE_EXTERN
-       BB_DEF_MESSAGE(too_few_args, "too few arguments\n")
+       BB_DEF_MESSAGE(too_few_args, "too few arguments")
 #endif
 #if defined bb_need_name_longer_than_foo || ! defined BB_DECLARE_EXTERN
-       BB_DEF_MESSAGE(name_longer_than_foo, "Names longer than %d chars not supported.\n")
+       BB_DEF_MESSAGE(name_longer_than_foo, "Names longer than %d chars not supported.")
 #endif
 
 
index d462100a21166e42c939915de6b0f761a1ed5253..122673a95a59d389edaf30d1438f7a020ff2d08f 100644 (file)
@@ -14,14 +14,14 @@ static unsigned int pointer;
 static void push(double a)
 {
        if (pointer >= (sizeof(stack) / sizeof(*stack)))
-               error_msg_and_die("stack overflow\n");
+               error_msg_and_die("stack overflow");
        stack[pointer++] = a;
 }
 
 static double pop()
 {
        if (pointer == 0)
-               error_msg_and_die("stack underflow\n");
+               error_msg_and_die("stack underflow");
        return stack[--pointer];
 }
 
@@ -120,7 +120,7 @@ static void stack_machine(const char *argument)
                }
                o++;
        }
-       error_msg_and_die("%s: syntax error.\n", argument);
+       error_msg_and_die("%s: syntax error.", argument);
 }
 
 /* return pointer to next token in buffer and set *buffer to one char
index 0d28339b99056f82c95dd4242aff17868e639365..683804b5a90458d654676075b878f6b01f805514 100644 (file)
@@ -76,7 +76,7 @@ extern int mt_main(int argc, char **argv)
        }
 
        if (code->name == 0) {
-               error_msg("unrecognized opcode %s.\n", argv[1]);
+               error_msg("unrecognized opcode %s.", argv[1]);
                return EXIT_FAILURE;
        }
 
diff --git a/mkdir.c b/mkdir.c
index 07b18713a9a2e2bb72d213c01c03b3831ea48015..299f29806d3a7804d871f55966c6d528f9648891 100644 (file)
--- a/mkdir.c
+++ b/mkdir.c
@@ -52,7 +52,7 @@ extern int mkdir_main(int argc, char **argv)
                                /* Find the specified modes */
                                mode = 0;
                                if (parse_mode(*(++argv), &mode) == FALSE) {
-                                       error_msg_and_die("Unknown mode: %s\n", *argv);
+                                       error_msg_and_die("Unknown mode: %s", *argv);
                                }
                                /* Set the umask for this process so it doesn't 
                                 * screw up whatever the user just entered. */
@@ -85,7 +85,7 @@ extern int mkdir_main(int argc, char **argv)
                strcpy(buf, *argv);
                status = stat(buf, &statBuf);
                if (parentFlag == FALSE && status != -1 && errno != ENOENT) {
-                       error_msg_and_die("%s: File exists\n", buf);
+                       error_msg_and_die("%s: File exists", buf);
                }
                if (parentFlag == TRUE) {
                        strcat(buf, "/");
index 21965d3b1c0adc77bc19dec7354b8bd1480300ee..a2b6d8a6e5547dc196627bac05aee12a21b88a79 100644 (file)
@@ -279,7 +279,7 @@ static void check_mount(void)
        if (!mnt)
                return;
 
-       error_msg_and_die("%s is mounted; will not make a filesystem here!\n", device_name);
+       error_msg_and_die("%s is mounted; will not make a filesystem here!", device_name);
 }
 
 static long valid_offset(int fd, int offset)
@@ -336,28 +336,28 @@ static void write_tables(void)
        Super.s_state &= ~MINIX_ERROR_FS;
 
        if (lseek(DEV, 0, SEEK_SET))
-               error_msg_and_die("seek to boot block failed in write_tables\n");
+               error_msg_and_die("seek to boot block failed in write_tables");
        if (512 != write(DEV, boot_block_buffer, 512))
-               error_msg_and_die("unable to clear boot sector\n");
+               error_msg_and_die("unable to clear boot sector");
        if (BLOCK_SIZE != lseek(DEV, BLOCK_SIZE, SEEK_SET))
-               error_msg_and_die("seek failed in write_tables\n");
+               error_msg_and_die("seek failed in write_tables");
        if (BLOCK_SIZE != write(DEV, super_block_buffer, BLOCK_SIZE))
-               error_msg_and_die("unable to write super-block\n");
+               error_msg_and_die("unable to write super-block");
        if (IMAPS * BLOCK_SIZE != write(DEV, inode_map, IMAPS * BLOCK_SIZE))
-               error_msg_and_die("unable to write inode map\n");
+               error_msg_and_die("unable to write inode map");
        if (ZMAPS * BLOCK_SIZE != write(DEV, zone_map, ZMAPS * BLOCK_SIZE))
-               error_msg_and_die("unable to write zone map\n");
+               error_msg_and_die("unable to write zone map");
        if (INODE_BUFFER_SIZE != write(DEV, inode_buffer, INODE_BUFFER_SIZE))
-               error_msg_and_die("unable to write inodes\n");
+               error_msg_and_die("unable to write inodes");
 
 }
 
 static void write_block(int blk, char *buffer)
 {
        if (blk * BLOCK_SIZE != lseek(DEV, blk * BLOCK_SIZE, SEEK_SET))
-               error_msg_and_die("seek failed in write_block\n");
+               error_msg_and_die("seek failed in write_block");
        if (BLOCK_SIZE != write(DEV, buffer, BLOCK_SIZE))
-               error_msg_and_die("write failed in write_block\n");
+               error_msg_and_die("write failed in write_block");
 }
 
 static int get_free_block(void)
@@ -365,7 +365,7 @@ static int get_free_block(void)
        int blk;
 
        if (used_good_blocks + 1 >= MAX_GOOD_BLOCKS)
-               error_msg_and_die("too many bad blocks\n");
+               error_msg_and_die("too many bad blocks");
        if (used_good_blocks)
                blk = good_blocks_table[used_good_blocks - 1] + 1;
        else
@@ -373,7 +373,7 @@ static int get_free_block(void)
        while (blk < ZONES && zone_in_use(blk))
                blk++;
        if (blk >= ZONES)
-               error_msg_and_die("not enough good blocks\n");
+               error_msg_and_die("not enough good blocks");
        good_blocks_table[used_good_blocks] = blk;
        used_good_blocks++;
        return blk;
@@ -439,7 +439,7 @@ static void make_bad_inode(void)
                                goto end_bad;
                }
        }
-       error_msg_and_die("too many bad blocks\n");
+       error_msg_and_die("too many bad blocks");
   end_bad:
        if (ind)
                write_block(ind, (char *) ind_block);
@@ -489,7 +489,7 @@ static void make_bad_inode2(void)
                }
        }
        /* Could make triple indirect block here */
-       error_msg_and_die("too many bad blocks\n");
+       error_msg_and_die("too many bad blocks");
   end_bad:
        if (ind)
                write_block(ind, (char *) ind_block);
@@ -590,7 +590,7 @@ static void setup_tables(void)
         * /sbin/mkfs.minix -i 200 test.fs
         * */
        if (i >= 999) {
-               error_msg_and_die("unable to allocate buffers for maps\n");
+               error_msg_and_die("unable to allocate buffers for maps");
        }
        FIRSTZONE = NORM_FIRSTZONE;
        inode_map = xmalloc(IMAPS * BLOCK_SIZE);
@@ -621,7 +621,7 @@ long do_check(char *buffer, int try, unsigned int current_block)
        /* Seek to the correct loc. */
        if (lseek(DEV, current_block * BLOCK_SIZE, SEEK_SET) !=
                current_block * BLOCK_SIZE) {
-               error_msg_and_die("seek failed during testing of blocks\n");
+               error_msg_and_die("seek failed during testing of blocks");
        }
 
 
@@ -661,7 +661,7 @@ static void check_blocks(void)
        while (currently_testing < ZONES) {
                if (lseek(DEV, currently_testing * BLOCK_SIZE, SEEK_SET) !=
                        currently_testing * BLOCK_SIZE)
-                       error_msg_and_die("seek failed in check_blocks\n");
+                       error_msg_and_die("seek failed in check_blocks");
                try = TEST_BUFFER_BLOCKS;
                if (currently_testing + try > ZONES)
                        try = ZONES - currently_testing;
@@ -670,7 +670,7 @@ static void check_blocks(void)
                if (got == try)
                        continue;
                if (currently_testing < FIRSTZONE)
-                       error_msg_and_die("bad blocks before data-area: cannot make fs\n");
+                       error_msg_and_die("bad blocks before data-area: cannot make fs");
                mark_zone(currently_testing);
                badblocks++;
                currently_testing++;
@@ -690,7 +690,7 @@ char *filename;
 
        listfile = fopen(filename, "r");
        if (listfile == (FILE *) NULL) {
-               error_msg_and_die("can't open file of bad blocks\n");
+               error_msg_and_die("can't open file of bad blocks");
        }
        while (!feof(listfile)) {
                fscanf(listfile, "%ld\n", &blockno);
@@ -712,10 +712,10 @@ extern int mkfs_minix_main(int argc, char **argv)
        int stopIt=FALSE;
 
        if (INODE_SIZE * MINIX_INODES_PER_BLOCK != BLOCK_SIZE)
-               error_msg_and_die("bad inode size\n");
+               error_msg_and_die("bad inode size");
 #ifdef BB_FEATURE_MINIX2
        if (INODE_SIZE2 * MINIX2_INODES_PER_BLOCK != BLOCK_SIZE)
-               error_msg_and_die("bad inode size\n");
+               error_msg_and_die("bad inode size");
 #endif
        
        /* Parse options */
@@ -781,7 +781,7 @@ extern int mkfs_minix_main(int argc, char **argv)
 #ifdef BB_FEATURE_MINIX2
                                                version2 = 1;
 #else
-                                               error_msg("%s: not compiled with minix v2 support\n",
+                                               error_msg("%s: not compiled with minix v2 support",
                                                                device_name);
                                                exit(-1);
 #endif
@@ -832,13 +832,13 @@ goodbye:
        strcpy(tmp + 2, ".badblocks");
        DEV = open(device_name, O_RDWR);
        if (DEV < 0)
-               error_msg_and_die("unable to open %s\n", device_name);
+               error_msg_and_die("unable to open %s", device_name);
        if (fstat(DEV, &statbuf) < 0)
-               error_msg_and_die("unable to stat %s\n", device_name);
+               error_msg_and_die("unable to stat %s", device_name);
        if (!S_ISBLK(statbuf.st_mode))
                check = 0;
        else if (statbuf.st_rdev == 0x0300 || statbuf.st_rdev == 0x0340)
-               error_msg_and_die("will not try to make filesystem on '%s'\n", device_name);
+               error_msg_and_die("will not try to make filesystem on '%s'", device_name);
        setup_tables();
        if (check)
                check_blocks();
index 8a3c900f31d02a579065c89f712ddc9d84830fd9..7d690ad99b5e7c6b18626211e5ed638d1cbd89e5 100644 (file)
--- a/mkswap.c
+++ b/mkswap.c
@@ -87,7 +87,7 @@ static void init_signature_page()
 
 #ifdef PAGE_SIZE
        if (pagesize != PAGE_SIZE)
-               error_msg("Assuming pages of size %d\n", pagesize);
+               error_msg("Assuming pages of size %d", pagesize);
 #endif
        signature_page = (int *) xmalloc(pagesize);
        memset(signature_page, 0, pagesize);
@@ -185,7 +185,7 @@ static void page_bad(int page)
                bit_test_and_clear(signature_page, page);
        else {
                if (badpages == MAX_BADPAGES)
-                       error_msg_and_die("too many bad pages\n");
+                       error_msg_and_die("too many bad pages");
                p->badpages[badpages] = page;
        }
        badpages++;
@@ -206,7 +206,7 @@ static void check_blocks(void)
                }
                if (do_seek && lseek(DEV, current_page * pagesize, SEEK_SET) !=
                        current_page * pagesize)
-                       error_msg_and_die("seek failed in check_blocks\n");
+                       error_msg_and_die("seek failed in check_blocks");
                if ((do_seek = (pagesize != read(DEV, buffer, pagesize)))) {
                        page_bad(current_page++);
                        continue;
@@ -307,14 +307,14 @@ int mkswap_main(int argc, char **argv)
                }
        }
        if (!device_name) {
-               error_msg("error: Nowhere to set up swap on?\n");
+               error_msg("error: Nowhere to set up swap on?");
                usage(mkswap_usage);
        }
        sz = get_size(device_name);
        if (!PAGES) {
                PAGES = sz;
        } else if (PAGES > sz && !force) {
-               error_msg("error: size %ld is larger than device size %d\n",
+               error_msg("error: size %ld is larger than device size %d",
                                PAGES * (pagesize / 1024), sz * (pagesize / 1024));
                return EXIT_FAILURE;
        }
@@ -330,11 +330,11 @@ int mkswap_main(int argc, char **argv)
                        version = 1;
        }
        if (version != 0 && version != 1) {
-               error_msg("error: unknown version %d\n", version);
+               error_msg("error: unknown version %d", version);
                usage(mkswap_usage);
        }
        if (PAGES < 10) {
-               error_msg("error: swap area needs to be at least %ldkB\n",
+               error_msg("error: swap area needs to be at least %ldkB",
                                (long) (10 * pagesize / 1024));
                usage(mkswap_usage);
        }
@@ -353,7 +353,7 @@ int mkswap_main(int argc, char **argv)
 #endif
        if (PAGES > maxpages) {
                PAGES = maxpages;
-               error_msg("warning: truncating swap area to %ldkB\n",
+               error_msg("warning: truncating swap area to %ldkB",
                                PAGES * pagesize / 1024);
        }
 
@@ -363,7 +363,7 @@ int mkswap_main(int argc, char **argv)
        if (!S_ISBLK(statbuf.st_mode))
                check = 0;
        else if (statbuf.st_rdev == 0x0300 || statbuf.st_rdev == 0x0340)
-               error_msg_and_die("Will not try to make swapdevice on '%s'\n", device_name);
+               error_msg_and_die("Will not try to make swapdevice on '%s'", device_name);
 
 #ifdef __sparc__
        if (!force && version == 0) {
@@ -372,7 +372,7 @@ int mkswap_main(int argc, char **argv)
                unsigned short *q, sum;
 
                if (read(DEV, buffer, 512) != 512)
-                       error_msg_and_die("fatal: first page unreadable\n");
+                       error_msg_and_die("fatal: first page unreadable");
                if (buffer[508] == 0xDA && buffer[509] == 0xBE) {
                        q = (unsigned short *) (buffer + 510);
                        for (sum = 0; q >= (unsigned short *) buffer;)
@@ -381,7 +381,7 @@ int mkswap_main(int argc, char **argv)
                                error_msg("Device '%s' contains a valid Sun disklabel.\n"
 "This probably means creating v0 swap would destroy your partition table\n"
 "No swap created. If you really want to create swap v0 on that device, use\n"
-"the -f option to force it.\n", device_name);
+"the -f option to force it.", device_name);
                                return EXIT_FAILURE;
                        }
                }
@@ -391,7 +391,7 @@ int mkswap_main(int argc, char **argv)
        if (version == 0 || check)
                check_blocks();
        if (version == 0 && !bit_test_and_clear(signature_page, 0))
-               error_msg_and_die("fatal: first page unreadable\n");
+               error_msg_and_die("fatal: first page unreadable");
        if (version == 1) {
                p->version = version;
                p->last_page = PAGES - 1;
@@ -400,23 +400,23 @@ int mkswap_main(int argc, char **argv)
 
        goodpages = PAGES - badpages - 1;
        if (goodpages <= 0)
-               error_msg_and_die("Unable to set up swap-space: unreadable\n");
+               error_msg_and_die("Unable to set up swap-space: unreadable");
        printf("Setting up swapspace version %d, size = %ld bytes\n",
                   version, (long) (goodpages * pagesize));
        write_signature((version == 0) ? "SWAP-SPACE" : "SWAPSPACE2");
 
        offset = ((version == 0) ? 0 : 1024);
        if (lseek(DEV, offset, SEEK_SET) != offset)
-               error_msg_and_die("unable to rewind swap-device\n");
+               error_msg_and_die("unable to rewind swap-device");
        if (write(DEV, (char *) signature_page + offset, pagesize - offset)
                != pagesize - offset)
-               error_msg_and_die("unable to write signature page\n");
+               error_msg_and_die("unable to write signature page");
 
        /*
         * A subsequent swapon() will fail if the signature
         * is not actually on disk. (This is a kernel bug.)
         */
        if (fsync(DEV))
-               error_msg_and_die("fsync failed\n");
+               error_msg_and_die("fsync failed");
        return EXIT_SUCCESS;
 }
index 57a152c013f8ae0ef7c7a36d974ae5cfc6fdf0ac..e55d9fafb115ec5748a8799ae276795a2f3ed162 100644 (file)
@@ -81,7 +81,7 @@
 #ifndef MODUTILS_MODULE_H
 static const int MODUTILS_MODULE_H = 1;
 
-#ident "$Id: insmod.c,v 1.44 2001/01/27 09:33:38 andersen Exp $"
+#ident "$Id: insmod.c,v 1.45 2001/01/31 19:00:21 kraai Exp $"
 
 /* This file contains the structures used by the 2.0 and 2.1 kernels.
    We do not use the kernel headers directly because we do not wish
@@ -287,7 +287,7 @@ int delete_module(const char *);
 #ifndef MODUTILS_OBJ_H
 static const int MODUTILS_OBJ_H = 1;
 
-#ident "$Id: insmod.c,v 1.44 2001/01/27 09:33:38 andersen Exp $"
+#ident "$Id: insmod.c,v 1.45 2001/01/31 19:00:21 kraai Exp $"
 
 /* The relocatable object is manipulated using elfin types.  */
 
@@ -1156,7 +1156,7 @@ struct obj_symbol *obj_add_symbol(struct obj_file *f, const char *name,
                                /* Don't report an error if the symbol is coming from
                                   the kernel or some external module.  */
                                if (secidx <= SHN_HIRESERVE)
-                                       error_msg("%s multiply defined\n", name);
+                                       error_msg("%s multiply defined", name);
                                return sym;
                        }
                }
@@ -1419,7 +1419,7 @@ old_process_module_arguments(struct obj_file *f, int argc, char **argv)
 
                /* Also check that the parameter was not resolved from the kernel.  */
                if (sym == NULL || sym->secidx > SHN_HIRESERVE) {
-                       error_msg("symbol for parameter %s not found\n", p);
+                       error_msg("symbol for parameter %s not found", p);
                        return 0;
                }
 
@@ -1432,7 +1432,7 @@ old_process_module_arguments(struct obj_file *f, int argc, char **argv)
                        str = alloca(strlen(q));
                        for (r = str, q++; *q != '"'; ++q, ++r) {
                                if (*q == '\0') {
-                                       error_msg("improperly terminated string argument for %s\n", p);
+                                       error_msg("improperly terminated string argument for %s", p);
                                        return 0;
                                } else if (*q == '\\')
                                        switch (*++q) {
@@ -1786,7 +1786,7 @@ new_process_module_arguments(struct obj_file *f, int argc, char **argv)
                p = get_modinfo_value(f, key);
                key += 5;
                if (p == NULL) {
-                       error_msg("invalid parameter %s\n", key);
+                       error_msg("invalid parameter %s", key);
                        return 0;
                }
 
@@ -1794,7 +1794,7 @@ new_process_module_arguments(struct obj_file *f, int argc, char **argv)
 
                /* Also check that the parameter was not resolved from the kernel.  */
                if (sym == NULL || sym->secidx > SHN_HIRESERVE) {
-                       error_msg("symbol for parameter %s not found\n", key);
+                       error_msg("symbol for parameter %s not found", key);
                        return 0;
                }
 
@@ -1822,7 +1822,7 @@ new_process_module_arguments(struct obj_file *f, int argc, char **argv)
                                        str = alloca(strlen(q));
                                        for (r = str, q++; *q != '"'; ++q, ++r) {
                                                if (*q == '\0') {
-                                                       error_msg("improperly terminated string argument for %s\n",
+                                                       error_msg("improperly terminated string argument for %s",
                                                                        key);
                                                        return 0;
                                                } else if (*q == '\\')
@@ -1917,14 +1917,14 @@ new_process_module_arguments(struct obj_file *f, int argc, char **argv)
                                        /* Probably we should do that outside the loop ? */
                                        if (!isdigit(*(p + 1))) {
                                                error_msg("parameter type 'c' for %s must be followed by"
-                                                               " the maximum size\n", key);
+                                                               " the maximum size", key);
                                                return 0;
                                        }
                                        charssize = strtoul(p + 1, (char **) NULL, 10);
 
                                        /* Check length */
                                        if (strlen(str) >= charssize) {
-                                               error_msg("string too long for %s (max %ld)\n", key,
+                                               error_msg("string too long for %s (max %ld)", key,
                                                                charssize - 1);
                                                return 0;
                                        }
@@ -1953,7 +1953,7 @@ new_process_module_arguments(struct obj_file *f, int argc, char **argv)
                                        break;
 
                                default:
-                                       error_msg("unknown parameter type '%c' for %s\n", *p, key);
+                                       error_msg("unknown parameter type '%c' for %s", *p, key);
                                        return 0;
                                }
                        }
@@ -1972,21 +1972,21 @@ new_process_module_arguments(struct obj_file *f, int argc, char **argv)
 
                        case ',':
                                if (++n > max) {
-                                       error_msg("too many values for %s (max %d)\n", key, max);
+                                       error_msg("too many values for %s (max %d)", key, max);
                                        return 0;
                                }
                                ++q;
                                break;
 
                        default:
-                               error_msg("invalid argument syntax for %s\n", key);
+                               error_msg("invalid argument syntax for %s", key);
                                return 0;
                        }
                }
 
          end_of_arg:
                if (n < min) {
-                       error_msg("too few values for %s (min %d)\n", key, min);
+                       error_msg("too few values for %s (min %d)", key, min);
                        return 0;
                }
 
@@ -2372,7 +2372,7 @@ int obj_check_undefineds(struct obj_file *f)
                                        sym->secidx = SHN_ABS;
                                        sym->value = 0;
                                } else {
-                                       error_msg("unresolved symbol %s\n", sym->name);
+                                       error_msg("unresolved symbol %s", sym->name);
                                        ret = 0;
                                }
                        }
@@ -2599,11 +2599,11 @@ int obj_relocate(struct obj_file *f, ElfW(Addr) base)
                                errmsg = "Unhandled relocation";
                          bad_reloc:
                                if (extsym) {
-                                       error_msg("%s of type %ld for %s\n", errmsg,
+                                       error_msg("%s of type %ld for %s", errmsg,
                                                        (long) ELFW(R_TYPE) (rel->r_info),
                                                        strtab + extsym->st_name);
                                } else {
-                                       error_msg("%s of type %ld\n", errmsg,
+                                       error_msg("%s of type %ld", errmsg,
                                                        (long) ELFW(R_TYPE) (rel->r_info));
                                }
                                ret = 0;
@@ -2688,25 +2688,25 @@ struct obj_file *obj_load(FILE * fp)
                || f->header.e_ident[EI_MAG1] != ELFMAG1
                || f->header.e_ident[EI_MAG2] != ELFMAG2
                || f->header.e_ident[EI_MAG3] != ELFMAG3) {
-               error_msg("not an ELF file\n");
+               error_msg("not an ELF file");
                return NULL;
        }
        if (f->header.e_ident[EI_CLASS] != ELFCLASSM
                || f->header.e_ident[EI_DATA] != ELFDATAM
                || f->header.e_ident[EI_VERSION] != EV_CURRENT
                || !MATCH_MACHINE(f->header.e_machine)) {
-               error_msg("ELF file not for this architecture\n");
+               error_msg("ELF file not for this architecture");
                return NULL;
        }
        if (f->header.e_type != ET_REL) {
-               error_msg("ELF file not a relocatable object\n");
+               error_msg("ELF file not a relocatable object");
                return NULL;
        }
 
        /* Read the section headers.  */
 
        if (f->header.e_shentsize != sizeof(ElfW(Shdr))) {
-               error_msg("section header size mismatch: %lu != %lu\n",
+               error_msg("section header size mismatch: %lu != %lu",
                                (unsigned long) f->header.e_shentsize,
                                (unsigned long) sizeof(ElfW(Shdr)));
                return NULL;
@@ -2759,11 +2759,11 @@ struct obj_file *obj_load(FILE * fp)
 
 #if SHT_RELM == SHT_REL
                case SHT_RELA:
-                       error_msg("RELA relocations not supported on this architecture\n");
+                       error_msg("RELA relocations not supported on this architecture");
                        return NULL;
 #else
                case SHT_REL:
-                       error_msg("REL relocations not supported on this architecture\n");
+                       error_msg("REL relocations not supported on this architecture");
                        return NULL;
 #endif
 
@@ -2776,7 +2776,7 @@ struct obj_file *obj_load(FILE * fp)
                                break;
                        }
 
-                       error_msg("can't handle sections of type %ld\n",
+                       error_msg("can't handle sections of type %ld",
                                        (long) sec->header.sh_type);
                        return NULL;
                }
@@ -2805,7 +2805,7 @@ struct obj_file *obj_load(FILE * fp)
                                ElfW(Sym) * sym;
 
                                if (sec->header.sh_entsize != sizeof(ElfW(Sym))) {
-                                       error_msg("symbol size mismatch: %lu != %lu\n",
+                                       error_msg("symbol size mismatch: %lu != %lu",
                                                        (unsigned long) sec->header.sh_entsize,
                                                        (unsigned long) sizeof(ElfW(Sym)));
                                        return NULL;
@@ -2837,7 +2837,7 @@ struct obj_file *obj_load(FILE * fp)
 
                case SHT_RELM:
                        if (sec->header.sh_entsize != sizeof(ElfW(RelM))) {
-                               error_msg("relocation entry size mismatch: %lu != %lu\n",
+                               error_msg("relocation entry size mismatch: %lu != %lu",
                                                (unsigned long) sec->header.sh_entsize,
                                                (unsigned long) sizeof(ElfW(RelM)));
                                return NULL;
@@ -2949,11 +2949,11 @@ extern int insmod_main( int argc, char **argv)
                        if (m_filename[0] == '\0'
                                || ((fp = fopen(m_filename, "r")) == NULL)) 
                        {
-                               error_msg("No module named '%s' found in '%s'\n", m_fullName, _PATH_MODULES);
+                               error_msg("No module named '%s' found in '%s'", m_fullName, _PATH_MODULES);
                                return EXIT_FAILURE;
                        }
                } else
-                       error_msg_and_die("No module named '%s' found in '%s'\n", m_fullName, _PATH_MODULES);
+                       error_msg_and_die("No module named '%s' found in '%s'", m_fullName, _PATH_MODULES);
        } else
                memcpy(m_filename, argv[optind], strlen(argv[optind]));
 
@@ -2976,7 +2976,7 @@ extern int insmod_main( int argc, char **argv)
                m_version = old_get_module_version(f, m_strversion);
                if (m_version == -1) {
                        error_msg("couldn't find the kernel version the module was "
-                                       "compiled for\n");
+                                       "compiled for");
                        goto out;
                }
        }
@@ -2985,12 +2985,12 @@ extern int insmod_main( int argc, char **argv)
                if (flag_force_load) {
                        error_msg("Warning: kernel-module version mismatch\n"
                                        "\t%s was compiled for kernel version %s\n"
-                                       "\twhile this kernel is version %s\n",
+                                       "\twhile this kernel is version %s",
                                        m_filename, m_strversion, k_strversion);
                } else {
                        error_msg("kernel-module version mismatch\n"
                                        "\t%s was compiled for kernel version %s\n"
-                                       "\twhile this kernel is version %s.\n",
+                                       "\twhile this kernel is version %s.",
                                        m_filename, m_strversion, k_strversion);
                        goto out;
                }
@@ -3006,7 +3006,7 @@ extern int insmod_main( int argc, char **argv)
                        goto out;
                k_crcs = new_is_kernel_checksummed();
 #else
-               error_msg("Not configured to support new kernels\n");
+               error_msg("Not configured to support new kernels");
                goto out;
 #endif
        } else {
@@ -3015,7 +3015,7 @@ extern int insmod_main( int argc, char **argv)
                        goto out;
                k_crcs = old_is_kernel_checksummed();
 #else
-               error_msg("Not configured to support old kernels\n");
+               error_msg("Not configured to support old kernels");
                goto out;
 #endif
        }
@@ -3072,10 +3072,10 @@ extern int insmod_main( int argc, char **argv)
        m_addr = create_module(m_name, m_size);
        if (m_addr==-1) switch (errno) {
        case EEXIST:
-               error_msg("A module named %s already exists\n", m_name);
+               error_msg("A module named %s already exists", m_name);
                goto out;
        case ENOMEM:
-               error_msg("Can't allocate kernel memory for module; needed %lu bytes\n",
+               error_msg("Can't allocate kernel memory for module; needed %lu bytes",
                                m_size);
                goto out;
        default:
diff --git a/mount.c b/mount.c
index f78786ebc012e73a288a110350f42fdd6d047939..b571e5035c658a3edd2ad20c8a271a02ab77451c 100644 (file)
--- a/mount.c
+++ b/mount.c
@@ -132,20 +132,20 @@ do_mount(char *specialfile, char *dir, char *filesystemtype,
 
                        specialfile = find_unused_loop_device();
                        if (specialfile == NULL) {
-                               error_msg_and_die("Could not find a spare loop device\n");
+                               error_msg_and_die("Could not find a spare loop device");
                        }
                        if (set_loop(specialfile, lofile, 0, &loro)) {
-                               error_msg_and_die("Could not setup loop device\n");
+                               error_msg_and_die("Could not setup loop device");
                        }
                        if (!(flags & MS_RDONLY) && loro) {     /* loop is ro, but wanted rw */
-                               error_msg("WARNING: loop device is read-only\n");
+                               error_msg("WARNING: loop device is read-only");
                                flags &= ~MS_RDONLY;
                        }
                }
 #endif
                status = mount(specialfile, dir, filesystemtype, flags, string_flags);
                if (errno == EROFS) {
-                       error_msg("%s is write-protected, mounting read-only\n", specialfile);
+                       error_msg("%s is write-protected, mounting read-only", specialfile);
                        status = mount(specialfile, dir, filesystemtype, flags |= MS_RDONLY, string_flags);
                }
        }
@@ -171,7 +171,7 @@ do_mount(char *specialfile, char *dir, char *filesystemtype,
 #endif
 
        if (errno == EPERM) {
-               error_msg_and_die("permission denied. Are you root?\n");
+               error_msg_and_die("permission denied. Are you root?");
        }
 
        return (FALSE);
diff --git a/mt.c b/mt.c
index 0d28339b99056f82c95dd4242aff17868e639365..683804b5a90458d654676075b878f6b01f805514 100644 (file)
--- a/mt.c
+++ b/mt.c
@@ -76,7 +76,7 @@ extern int mt_main(int argc, char **argv)
        }
 
        if (code->name == 0) {
-               error_msg("unrecognized opcode %s.\n", argv[1]);
+               error_msg("unrecognized opcode %s.", argv[1]);
                return EXIT_FAILURE;
        }
 
diff --git a/nc.c b/nc.c
index 7de4015ac24d50ee06c101a8a566dffe3d297862..682da82bf02037927dee97abde283abe9ea5a43a 100644 (file)
--- a/nc.c
+++ b/nc.c
@@ -59,7 +59,7 @@ int nc_main(int argc, char **argv)
                perror_msg_and_die("socket");
 
        if ((hostinfo = gethostbyname(*argv)) == NULL)
-               error_msg_and_die("cannot resolve %s\n", *argv);
+               error_msg_and_die("cannot resolve %s", *argv);
 
        address.sin_family = AF_INET;
        address.sin_addr = *(struct in_addr *) *hostinfo->h_addr_list;
index a789fa0f15d9a787691ae286db52f38bf3b3e63b..3dba641540e2c8da76c6fedfae5e189a7ed7a9a6 100644 (file)
@@ -1,6 +1,6 @@
 /* vi: set sw=4 ts=4: */
 /*
- * $Id: hostname.c,v 1.21 2001/01/27 08:24:37 andersen Exp $
+ * $Id: hostname.c,v 1.22 2001/01/31 19:00:20 kraai Exp $
  * Mini hostname implementation for busybox
  *
  * Copyright (C) 1999 by Randolph Chung <tausq@debian.org>
@@ -41,7 +41,7 @@ void do_sethostname(char *s, int isfile)
        if (!isfile) {
                if (sethostname(s, strlen(s)) < 0) {
                        if (errno == EPERM)
-                               error_msg_and_die("you must be root to change the hostname\n");
+                               error_msg_and_die("you must be root to change the hostname");
                        else
                                perror_msg_and_die("sethostname");
                }
index 7de4015ac24d50ee06c101a8a566dffe3d297862..682da82bf02037927dee97abde283abe9ea5a43a 100644 (file)
@@ -59,7 +59,7 @@ int nc_main(int argc, char **argv)
                perror_msg_and_die("socket");
 
        if ((hostinfo = gethostbyname(*argv)) == NULL)
-               error_msg_and_die("cannot resolve %s\n", *argv);
+               error_msg_and_die("cannot resolve %s", *argv);
 
        address.sin_family = AF_INET;
        address.sin_addr = *(struct in_addr *) *hostinfo->h_addr_list;
index a2e9163624daa8b7df2cf610c733273b8412c06d..15611babd3d9c18d8ccb7e8355c0f1077fcb556c 100644 (file)
@@ -1,6 +1,6 @@
 /* vi: set sw=4 ts=4: */
 /*
- * $Id: ping.c,v 1.35 2001/01/27 08:24:37 andersen Exp $
+ * $Id: ping.c,v 1.36 2001/01/31 19:00:21 kraai Exp $
  * Mini ping implementation for busybox
  *
  * Copyright (C) 1999 by Randolph Chung <tausq@debian.org>
@@ -203,7 +203,7 @@ static void ping(const char *host)
 
        pingaddr.sin_family = AF_INET;
        if (!(h = gethostbyname(host))) {
-               error_msg("unknown host %s\n", host);
+               error_msg("unknown host %s", host);
                exit(1);
        }
        memcpy(&pingaddr.sin_addr, h->h_addr, sizeof(pingaddr.sin_addr));
@@ -324,7 +324,7 @@ static void sendping(int junk)
        if (i < 0)
                perror_msg_and_die("sendto");
        else if ((size_t)i != sizeof(packet))
-               error_msg_and_die("ping wrote %d chars; %d expected\n", i,
+               error_msg_and_die("ping wrote %d chars; %d expected", i,
                           (int)sizeof(packet));
 
        signal(SIGALRM, sendping);
@@ -419,7 +419,7 @@ static void unpack(char *buf, int sz, struct sockaddr_in *from)
                printf("\n");
        } else 
                if (icmppkt->icmp_type != ICMP_ECHO)
-                       error_msg("Warning: Got ICMP %d (%s)\n",
+                       error_msg("Warning: Got ICMP %d (%s)",
                                        icmppkt->icmp_type, icmp_type_name (icmppkt->icmp_type));
 }
 
@@ -437,7 +437,7 @@ static void ping(const char *host)
        if ((pingsock = socket(AF_INET, SOCK_RAW,
                                                   (proto ? proto->p_proto : 1))) < 0) {        /* 1 == ICMP */
                if (errno == EPERM)
-                       error_msg_and_die("permission denied. (are you root?)\n");
+                       error_msg_and_die("permission denied. (are you root?)");
                else
                        perror_msg_and_die("creating a raw socket");
        }
@@ -449,12 +449,12 @@ static void ping(const char *host)
 
        pingaddr.sin_family = AF_INET;
        if (!(h = gethostbyname(host))) {
-               error_msg("unknown host %s\n", host);
+               error_msg("unknown host %s", host);
                exit(1);
        }
 
        if (h->h_addrtype != AF_INET) {
-               error_msg("unknown address type; only AF_INET is currently supported.\n");
+               error_msg("unknown address type; only AF_INET is currently supported.");
                exit(1);
        }
 
index 8f7bbf29b8fac1f4571cecef86acc6447d9073ff..b08effed7d4078e0ab101448452401b4dd1179b1 100644 (file)
@@ -584,7 +584,7 @@ static int getport(char * p)
 
        if ((unsigned)(port - 1 ) > 65534)
        {
-               error_msg_and_die("%s: bad port number\n", p);
+               error_msg_and_die("%s: bad port number", p);
        }
        return port;
 }
@@ -596,7 +596,7 @@ static struct in_addr getserver(char * host)
        struct hostent * he;
        if ((he = gethostbyname(host)) == NULL)
        {
-               error_msg_and_die("%s: Unknown host\n", host);
+               error_msg_and_die("%s: Unknown host", host);
        }
        memcpy(&addr, he->h_addr, sizeof addr);
 
index 729c6fdc7d501767b78f0b9686b27af83a6867e1..70f8d1b89bb0f021b5ed84a3e4fac5992417362a 100644 (file)
@@ -148,7 +148,7 @@ int wget_main(int argc, char **argv)
 #endif
        }
        if (do_continue && !fname_out)
-               error_msg_and_die("cannot specify continue (-c) without a filename (-O)\n");
+               error_msg_and_die("cannot specify continue (-c) without a filename (-O)");
 
 
        /*
@@ -200,7 +200,7 @@ int wget_main(int argc, char **argv)
         */
        if (fgets(buf, sizeof(buf), sfp) == NULL) {
                close_and_delete_outfile(output, fname_out, do_continue);
-               error_msg_and_die("no response from server\n");
+               error_msg_and_die("no response from server");
        }
        for (s = buf ; *s != '\0' && !isspace(*s) ; ++s)
                ;
@@ -230,7 +230,7 @@ int wget_main(int argc, char **argv)
                }
                if (strcasecmp(buf, "transfer-encoding") == 0) {
                        close_and_delete_outfile(output, fname_out, do_continue);
-                       error_msg_and_die("server wants to do %s transfer encoding\n", s);
+                       error_msg_and_die("server wants to do %s transfer encoding", s);
                        continue;
                }
        }
@@ -267,7 +267,7 @@ void parse_url(char *url, char **uri_host, int *uri_port, char **uri_path)
        *uri_port = 80;
 
        if (strncmp(url, "http://", 7) != 0)
-               error_msg_and_die("not an http url: %s\n", url);
+               error_msg_and_die("not an http url: %s", url);
 
        *uri_host = url + 7;
 
@@ -297,7 +297,7 @@ FILE *open_socket(char *host, int port)
        memset(&sin, 0, sizeof(sin));
        sin.sin_family = AF_INET;
        if ((hp = (struct hostent *) gethostbyname(host)) == NULL)
-               error_msg_and_die("cannot resolve %s\n", host);
+               error_msg_and_die("cannot resolve %s", host);
        memcpy(&sin.sin_addr, hp->h_addr_list[0], hp->h_length);
        sin.sin_port = htons(port);
 
@@ -338,7 +338,7 @@ char *gethdr(char *buf, size_t bufsiz, FILE *fp, int *istrunc)
 
        /* verify we are at the end of the header name */
        if (*s != ':')
-               error_msg_and_die("bad header line: %s\n", buf);
+               error_msg_and_die("bad header line: %s", buf);
 
        /* locate the start of the header value */
        for (*s++ = '\0' ; *s == ' ' || *s == '\t' ; ++s)
@@ -532,7 +532,7 @@ progressmeter(int flag)
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  *
- *     $Id: wget.c,v 1.24 2001/01/31 17:49:47 andersen Exp $
+ *     $Id: wget.c,v 1.25 2001/01/31 19:00:21 kraai Exp $
  */
 
 
index b260a885f3faa2eb2dff475d6910701997423562..397858b7196515a4a5d7f7d4ada25a418a4d6905 100644 (file)
@@ -307,7 +307,7 @@ int nfsmount(const char *spec, const char *node, int *flags,
        msock = fsock = -1;
        mclient = NULL;
        if (strlen(spec) >= sizeof(hostdir)) {
-               error_msg("excessively long host:dir argument\n");
+               error_msg("excessively long host:dir argument");
                goto fail;
        }
        strcpy(hostdir, spec);
@@ -319,10 +319,10 @@ int nfsmount(const char *spec, const char *node, int *flags,
                   until they can be fully supported. (mack@sgi.com) */
                if ((s = strchr(hostdir, ','))) {
                        *s = '\0';
-                       error_msg("warning: multiple hostnames not supported\n");
+                       error_msg("warning: multiple hostnames not supported");
                }
        } else {
-               error_msg("directory to mount not in host:dir format\n");
+               error_msg("directory to mount not in host:dir format");
                goto fail;
        }
 
@@ -332,11 +332,11 @@ int nfsmount(const char *spec, const char *node, int *flags,
 #endif
        {
                if ((hp = gethostbyname(hostname)) == NULL) {
-                       error_msg("can't get address for %s\n", hostname);
+                       error_msg("can't get address for %s", hostname);
                        goto fail;
                } else {
                        if (hp->h_length > sizeof(struct in_addr)) {
-                               error_msg("got bad hp->h_length\n");
+                               error_msg("got bad hp->h_length");
                                hp->h_length = sizeof(struct in_addr);
                        }
                        memcpy(&server_addr.sin_addr,
@@ -353,7 +353,7 @@ int nfsmount(const char *spec, const char *node, int *flags,
        if (!old_opts)
                old_opts = "";
        if (strlen(old_opts) + strlen(s) + 10 >= sizeof(new_opts)) {
-               error_msg("excessively long option argument\n");
+               error_msg("excessively long option argument");
                goto fail;
        }
        sprintf(new_opts, "%s%saddr=%s",
@@ -513,11 +513,11 @@ int nfsmount(const char *spec, const char *node, int *flags,
                data.flags |= (nolock ? NFS_MOUNT_NONLM : 0);
 #endif
        if (nfsvers > MAX_NFSPROT) {
-               error_msg("NFSv%d not supported!\n", nfsvers);
+               error_msg("NFSv%d not supported!", nfsvers);
                return 0;
        }
        if (mountvers > MAX_NFSPROT) {
-               error_msg("NFSv%d not supported!\n", nfsvers);
+               error_msg("NFSv%d not supported!", nfsvers);
                return 0;
        }
        if (nfsvers && !mountvers)
@@ -577,11 +577,11 @@ int nfsmount(const char *spec, const char *node, int *flags,
            mount_server_addr.sin_addr.s_addr = inet_addr(hostname);
          } else {
                  if ((hp = gethostbyname(mounthost)) == NULL) {
-                         error_msg("can't get address for %s\n", hostname);
+                         error_msg("can't get address for %s", hostname);
                          goto fail;
                  } else {
                          if (hp->h_length > sizeof(struct in_addr)) {
-                                 error_msg("got bad hp->h_length?\n");
+                                 error_msg("got bad hp->h_length?");
                                  hp->h_length = sizeof(struct in_addr);
                          }
                          mount_server_addr.sin_family = AF_INET;
@@ -716,7 +716,7 @@ int nfsmount(const char *spec, const char *node, int *flags,
 
        if (nfsvers == 2) {
                if (status.nfsv2.fhs_status != 0) {
-                       error_msg("%s:%s failed, reason given by server: %s\n",
+                       error_msg("%s:%s failed, reason given by server: %s",
                                hostname, dirname,
                                nfs_strerror(status.nfsv2.fhs_status));
                        goto fail;
@@ -734,7 +734,7 @@ int nfsmount(const char *spec, const char *node, int *flags,
 #if NFS_MOUNT_VERSION >= 4
                fhandle3 *fhandle;
                if (status.nfsv3.fhs_status != 0) {
-                       error_msg("%s:%s failed, reason given by server: %s\n",
+                       error_msg("%s:%s failed, reason given by server: %s",
                                hostname, dirname,
                                nfs_strerror(status.nfsv3.fhs_status));
                        goto fail;
diff --git a/ping.c b/ping.c
index a2e9163624daa8b7df2cf610c733273b8412c06d..15611babd3d9c18d8ccb7e8355c0f1077fcb556c 100644 (file)
--- a/ping.c
+++ b/ping.c
@@ -1,6 +1,6 @@
 /* vi: set sw=4 ts=4: */
 /*
- * $Id: ping.c,v 1.35 2001/01/27 08:24:37 andersen Exp $
+ * $Id: ping.c,v 1.36 2001/01/31 19:00:21 kraai Exp $
  * Mini ping implementation for busybox
  *
  * Copyright (C) 1999 by Randolph Chung <tausq@debian.org>
@@ -203,7 +203,7 @@ static void ping(const char *host)
 
        pingaddr.sin_family = AF_INET;
        if (!(h = gethostbyname(host))) {
-               error_msg("unknown host %s\n", host);
+               error_msg("unknown host %s", host);
                exit(1);
        }
        memcpy(&pingaddr.sin_addr, h->h_addr, sizeof(pingaddr.sin_addr));
@@ -324,7 +324,7 @@ static void sendping(int junk)
        if (i < 0)
                perror_msg_and_die("sendto");
        else if ((size_t)i != sizeof(packet))
-               error_msg_and_die("ping wrote %d chars; %d expected\n", i,
+               error_msg_and_die("ping wrote %d chars; %d expected", i,
                           (int)sizeof(packet));
 
        signal(SIGALRM, sendping);
@@ -419,7 +419,7 @@ static void unpack(char *buf, int sz, struct sockaddr_in *from)
                printf("\n");
        } else 
                if (icmppkt->icmp_type != ICMP_ECHO)
-                       error_msg("Warning: Got ICMP %d (%s)\n",
+                       error_msg("Warning: Got ICMP %d (%s)",
                                        icmppkt->icmp_type, icmp_type_name (icmppkt->icmp_type));
 }
 
@@ -437,7 +437,7 @@ static void ping(const char *host)
        if ((pingsock = socket(AF_INET, SOCK_RAW,
                                                   (proto ? proto->p_proto : 1))) < 0) {        /* 1 == ICMP */
                if (errno == EPERM)
-                       error_msg_and_die("permission denied. (are you root?)\n");
+                       error_msg_and_die("permission denied. (are you root?)");
                else
                        perror_msg_and_die("creating a raw socket");
        }
@@ -449,12 +449,12 @@ static void ping(const char *host)
 
        pingaddr.sin_family = AF_INET;
        if (!(h = gethostbyname(host))) {
-               error_msg("unknown host %s\n", host);
+               error_msg("unknown host %s", host);
                exit(1);
        }
 
        if (h->h_addrtype != AF_INET) {
-               error_msg("unknown address type; only AF_INET is currently supported.\n");
+               error_msg("unknown address type; only AF_INET is currently supported.");
                exit(1);
        }
 
index 3eb829abf41372ebc86ba6bc55ed42242fd59bf5..00a4d5c402c612b1c1cf9f555caa80b19b9433c0 100644 (file)
@@ -223,7 +223,7 @@ extern int kill_main(int argc, char **argv)
                        pidList = find_pid_by_name( *argv);
                        if (!pidList) {
                                all_found = FALSE;
-                               error_msg( "%s: no process killed\n", *argv);
+                               error_msg( "%s: no process killed", *argv);
                        }
 
                        for(; pidList && *pidList!=0; pidList++) {
@@ -246,5 +246,5 @@ extern int kill_main(int argc, char **argv)
 
 
   end:
-       error_msg_and_die( "bad signal name: %s\n", *argv);
+       error_msg_and_die( "bad signal name: %s", *argv);
 }
index 08597fe3a9a05211d21a42b2aba6c48037ffea6f..4ff7a8a58cab7b47137a4f8900f2c0dc76f877d1 100644 (file)
@@ -99,20 +99,20 @@ static void parse_proc_status(char *S, proc_t * P)
        if (tmp)
                sscanf(tmp, "Pid:\t%d\n" "PPid:\t%d\n", &P->pid, &P->ppid);
        else
-               error_msg("Internal error!\n");
+               error_msg("Internal error!");
 
        /* For busybox, ignoring effective, saved, etc */
        tmp = strstr(S, "Uid:");
        if (tmp)
                sscanf(tmp, "Uid:\t%d", &P->ruid);
        else
-               error_msg("Internal error!\n");
+               error_msg("Internal error!");
 
        tmp = strstr(S, "Gid:");
        if (tmp)
                sscanf(tmp, "Gid:\t%d", &P->rgid);
        else
-               error_msg("Internal error!\n");
+               error_msg("Internal error!");
 
 }
 
@@ -137,7 +137,7 @@ extern int ps_main(int argc, char **argv)
 
        dir = opendir("/proc");
        if (!dir)
-               error_msg_and_die("Can't open /proc\n");
+               error_msg_and_die("Can't open /proc");
 
 #ifdef BB_FEATURE_AUTOWIDTH
                ioctl(fileno(stdout), TIOCGWINSZ, &win);
diff --git a/ps.c b/ps.c
index 08597fe3a9a05211d21a42b2aba6c48037ffea6f..4ff7a8a58cab7b47137a4f8900f2c0dc76f877d1 100644 (file)
--- a/ps.c
+++ b/ps.c
@@ -99,20 +99,20 @@ static void parse_proc_status(char *S, proc_t * P)
        if (tmp)
                sscanf(tmp, "Pid:\t%d\n" "PPid:\t%d\n", &P->pid, &P->ppid);
        else
-               error_msg("Internal error!\n");
+               error_msg("Internal error!");
 
        /* For busybox, ignoring effective, saved, etc */
        tmp = strstr(S, "Uid:");
        if (tmp)
                sscanf(tmp, "Uid:\t%d", &P->ruid);
        else
-               error_msg("Internal error!\n");
+               error_msg("Internal error!");
 
        tmp = strstr(S, "Gid:");
        if (tmp)
                sscanf(tmp, "Gid:\t%d", &P->rgid);
        else
-               error_msg("Internal error!\n");
+               error_msg("Internal error!");
 
 }
 
@@ -137,7 +137,7 @@ extern int ps_main(int argc, char **argv)
 
        dir = opendir("/proc");
        if (!dir)
-               error_msg_and_die("Can't open /proc\n");
+               error_msg_and_die("Can't open /proc");
 
 #ifdef BB_FEATURE_AUTOWIDTH
                ioctl(fileno(stdout), TIOCGWINSZ, &win);
diff --git a/rdate.c b/rdate.c
index 0ad339be8aa370de44135182d8f59db9a9db764c..d350be87724b0e46d39a368ad018669f7fec4056 100644 (file)
--- a/rdate.c
+++ b/rdate.c
@@ -72,7 +72,7 @@ time_t askremotedate(char *host)
        }
        if (read(fd, (void *)&nett, 4) != 4) {  /* read time from server */
                close(fd);
-               error_msg("%s did not send the complete time\n", host);
+               error_msg("%s did not send the complete time", host);
        }
        close(fd);
 
index 85c7c9c1ee3fc1aaf4a77734bbd7e8b0410f0b00..e37ac2cfad18f7a80cc06dc6c8471066985e6fd6 100644 (file)
@@ -44,7 +44,7 @@ static void myread(int num, char *buffer)
        if (err < 0)
                perror_msg_and_die(progname);
        else
-               error_msg_and_die("Unexpected end of input file!\n");
+               error_msg_and_die("Unexpected end of input file!");
   }
 }
 
diff --git a/sed.c b/sed.c
index 73a9ad3ec23800392a7b1152df6e8fc03b277229..e0351c3b80f6ae3029b68a4450467728a26dbc4d 100644 (file)
--- a/sed.c
+++ b/sed.c
@@ -169,7 +169,7 @@ static int get_address(struct sed_cmd *sed_cmd, const char *str, int *line, rege
        else if (my_str[idx] == '/') {
                idx = index_of_next_unescaped_regexp_delim(sed_cmd, my_str, ++idx);
                if (idx == -1)
-                       error_msg_and_die("unterminated match expression\n");
+                       error_msg_and_die("unterminated match expression");
                my_str[idx] = '\0';
                *regex = (regex_t *)xmalloc(sizeof(regex_t));
                xregcomp(*regex, my_str+1, 0);
@@ -177,7 +177,7 @@ static int get_address(struct sed_cmd *sed_cmd, const char *str, int *line, rege
        }
        else {
                error_msg("get_address: no address found in string\n"
-                               "\t(you probably didn't check the string you passed me)\n");
+                               "\t(you probably didn't check the string you passed me)");
                idx = -1;
        }
 
@@ -213,7 +213,7 @@ static int parse_subst_cmd(struct sed_cmd *sed_cmd, const char *substr)
        /* verify that the 's' is followed by something.  That something
         * (typically a 'slash') is now our regexp delimiter... */
        if (!substr[++idx])
-               error_msg_and_die("bad format in substitution expression\n");
+               error_msg_and_die("bad format in substitution expression");
        else
            sed_cmd->delimiter=substr[idx];
 
@@ -221,7 +221,7 @@ static int parse_subst_cmd(struct sed_cmd *sed_cmd, const char *substr)
        oldidx = idx+1;
        idx = index_of_next_unescaped_regexp_delim(sed_cmd, substr, ++idx);
        if (idx == -1)
-               error_msg_and_die("bad format in substitution expression\n");
+               error_msg_and_die("bad format in substitution expression");
        match = strdup_substr(substr, oldidx, idx);
 
        /* determine the number of back references in the match string */
@@ -240,7 +240,7 @@ static int parse_subst_cmd(struct sed_cmd *sed_cmd, const char *substr)
        oldidx = idx+1;
        idx = index_of_next_unescaped_regexp_delim(sed_cmd, substr, ++idx);
        if (idx == -1)
-               error_msg_and_die("bad format in substitution expression\n");
+               error_msg_and_die("bad format in substitution expression");
        sed_cmd->replace = strdup_substr(substr, oldidx, idx);
 
        /* process the flags */
@@ -260,7 +260,7 @@ static int parse_subst_cmd(struct sed_cmd *sed_cmd, const char *substr)
                                if (strchr("; \t\v\n\r", substr[idx]))
                                        goto out;
                                /* else */
-                               error_msg_and_die("bad option in substitution expression\n");
+                               error_msg_and_die("bad option in substitution expression");
                }
        }
 
@@ -302,7 +302,7 @@ static int parse_edit_cmd(struct sed_cmd *sed_cmd, const char *editstr)
         */
 
        if (editstr[1] != '\\' && (editstr[2] != '\n' || editstr[2] != '\r'))
-               error_msg_and_die("bad format in edit expression\n");
+               error_msg_and_die("bad format in edit expression");
 
        /* store the edit line text */
        /* make editline big enough to accomodate the extra '\n' we will tack on
@@ -366,9 +366,9 @@ static char *parse_cmd_str(struct sed_cmd *sed_cmd, const char *cmdstr)
 
        /* last part (mandatory) will be a command */
        if (cmdstr[idx] == '\0')
-               error_msg_and_die("missing command\n");
+               error_msg_and_die("missing command");
        if (!strchr("pdsaic", cmdstr[idx])) /* <-- XXX add new commands here */
-               error_msg_and_die("invalid command\n");
+               error_msg_and_die("invalid command");
        sed_cmd->cmd = cmdstr[idx];
 
        /* special-case handling for (s)ubstitution */
@@ -378,7 +378,7 @@ static char *parse_cmd_str(struct sed_cmd *sed_cmd, const char *cmdstr)
        /* special-case handling for (a)ppend, (i)nsert, and (c)hange */
        else if (strchr("aic", cmdstr[idx])) {
                if (sed_cmd->end_line || sed_cmd->end_match)
-                       error_msg_and_die("only a beginning address can be specified for edit commands\n");
+                       error_msg_and_die("only a beginning address can be specified for edit commands");
                idx += parse_edit_cmd(sed_cmd, &cmdstr[idx]);
        }
        /* if it was a single-letter command (such as 'p' or 'd') we need to
index be9b1b79769a79f2bca59323c2768dde81c046f4..3e511ad00d46fcd516b9d009afa8446c675814c5 100644 (file)
@@ -52,18 +52,18 @@ setkeycodes_main(int argc, char** argv)
        a.keycode = atoi(argv[2]);
        a.scancode = sc = strtol(argv[1], &ep, 16);
        if (*ep) {
-      error_msg_and_die("error reading SCANCODE: '%s'\n", argv[1]);
+      error_msg_and_die("error reading SCANCODE: '%s'", argv[1]);
        }
        if (a.scancode > 127) {
            a.scancode -= 0xe000;
            a.scancode += 128;
        }
        if (a.scancode > 255 || a.keycode > 127) {
-      error_msg_and_die("SCANCODE or KEYCODE outside bounds\n");
+      error_msg_and_die("SCANCODE or KEYCODE outside bounds");
        }
        if (ioctl(fd,KDSETKEYCODE,&a)) {
            perror("KDSETKEYCODE");
-               error_msg_and_die("failed to set SCANCODE %x to KEYCODE %d\n", sc, a.keycode);
+               error_msg_and_die("failed to set SCANCODE %x to KEYCODE %d", sc, a.keycode);
        }
        argc -= 2;
        argv += 2;
diff --git a/sh.c b/sh.c
index b3bdcc986a41648ed73c7812133cf5cfa2bc8a49..cc0d78687fdd301c4bc06ced330a9211ea2646c8 100644 (file)
--- a/sh.c
+++ b/sh.c
@@ -321,13 +321,13 @@ static int builtin_fg_bg(struct child_prog *child)
        struct job *job=NULL;
        
        if (!child->argv[1] || child->argv[2]) {
-               error_msg("%s: exactly one argument is expected\n",
+               error_msg("%s: exactly one argument is expected",
                                child->argv[0]);
                return EXIT_FAILURE;
        }
 
        if (sscanf(child->argv[1], "%%%d", &jobNum) != 1) {
-               error_msg("%s: bad argument '%s'\n",
+               error_msg("%s: bad argument '%s'",
                                child->argv[0], child->argv[1]);
                return EXIT_FAILURE;
        }
@@ -339,7 +339,7 @@ static int builtin_fg_bg(struct child_prog *child)
        }
 
        if (!job) {
-               error_msg("%s: unknown job %d\n",
+               error_msg("%s: unknown job %d",
                                child->argv[0], jobNum);
                return EXIT_FAILURE;
        }
@@ -492,7 +492,7 @@ static int builtin_then(struct child_prog *child)
        debug_printf( "job=%p entering builtin_then ('%s')-- context=%d\n", cmd, charptr1, cmd->job_context);
        if (! (cmd->job_context & (IF_TRUE_CONTEXT|IF_FALSE_CONTEXT))) {
                shell_context = 0; /* Reset the shell's context on an error */
-               error_msg("%s `then'\n", syntax_err);
+               error_msg("%s `then'", syntax_err);
                return EXIT_FAILURE;
        }
 
@@ -520,7 +520,7 @@ static int builtin_else(struct child_prog *child)
 
        if (! (cmd->job_context & THEN_EXP_CONTEXT)) {
                shell_context = 0; /* Reset the shell's context on an error */
-               error_msg("%s `else'\n", syntax_err);
+               error_msg("%s `else'", syntax_err);
                return EXIT_FAILURE;
        }
        /* If the if result was TRUE, skip the 'else' stuff */
@@ -543,7 +543,7 @@ static int builtin_fi(struct child_prog *child)
        debug_printf( "job=%p entering builtin_fi ('%s')-- context=%d\n", cmd, "", cmd->job_context);
        if (! (cmd->job_context & (IF_TRUE_CONTEXT|IF_FALSE_CONTEXT))) {
                shell_context = 0; /* Reset the shell's context on an error */
-               error_msg("%s `fi'\n", syntax_err);
+               error_msg("%s `fi'", syntax_err);
                return EXIT_FAILURE;
        }
        /* Clear out the if and then context bits */
@@ -748,7 +748,7 @@ static int setup_redirects(struct child_prog *prog, int squirrel[])
                if (openfd < 0) {
                        /* this could get lost if stderr has been redirected, but
                           bash and ash both lose it as well (though zsh doesn't!) */
-                       error_msg("error opening %s: %s\n", redir->filename,
+                       error_msg("error opening %s: %s", redir->filename,
                                        strerror(errno));
                        return 1;
                }
@@ -960,7 +960,7 @@ static void expand_argument(struct child_prog *prog, int *argcPtr,
        if (strpbrk(prog->argv[argc_l - 1],"*[]?")!= NULL){
                rc = glob(prog->argv[argc_l - 1], flags, NULL, &prog->glob_result);
                if (rc == GLOB_NOSPACE) {
-                       error_msg("out of space during glob operation\n");
+                       error_msg("out of space during glob operation");
                        return;
                } else if (rc == GLOB_NOMATCH ||
                           (!rc && (prog->glob_result.gl_pathc - i) == 1 &&
@@ -1068,7 +1068,7 @@ static int parse_command(char **command_ptr, struct job *job, int *inbg)
                        if (*src == '\\') {
                                src++;
                                if (!*src) {
-                                       error_msg("character expected after \\\n");
+                                       error_msg("character expected after \\");
                                        free_job(job);
                                        return 1;
                                }
@@ -1152,7 +1152,7 @@ static int parse_command(char **command_ptr, struct job *job, int *inbg)
                                        chptr++;
 
                                if (!*chptr) {
-                                       error_msg("file name expected after %c\n", *src);
+                                       error_msg("file name expected after %c", *src);
                                        free_job(job);
                                        job->num_progs=0;
                                        return 1;
@@ -1171,7 +1171,7 @@ static int parse_command(char **command_ptr, struct job *job, int *inbg)
                                if (*prog->argv[argc_l])
                                        argc_l++;
                                if (!argc_l) {
-                                       error_msg("empty command in pipe\n");
+                                       error_msg("empty command in pipe");
                                        free_job(job);
                                        job->num_progs=0;
                                        return 1;
@@ -1199,7 +1199,7 @@ static int parse_command(char **command_ptr, struct job *job, int *inbg)
                                        src++;
 
                                if (!*src) {
-                                       error_msg("empty command in pipe\n");
+                                       error_msg("empty command in pipe");
                                        free_job(job);
                                        job->num_progs=0;
                                        return 1;
@@ -1307,7 +1307,7 @@ static int parse_command(char **command_ptr, struct job *job, int *inbg)
                                        printf("erik: found a continue char at EOL...\n");
                                        command = (char *) xcalloc(BUFSIZ, sizeof(char));
                                        if (get_command(input, command)) {
-                                               error_msg("character expected after \\\n");
+                                               error_msg("character expected after \\");
                                                free(command);
                                                free_job(job);
                                                return 1;
@@ -1323,7 +1323,7 @@ static int parse_command(char **command_ptr, struct job *job, int *inbg)
                                        free(command);
                                        break;
 #else
-                                       error_msg("character expected after \\\n");
+                                       error_msg("character expected after \\");
                                        free(command);
                                        free_job(job);
                                        return 1;
@@ -1738,7 +1738,7 @@ int shell_main(int argc_l, char **argv_l)
                        case 'c':
                                input = NULL;
                                if (local_pending_command != 0)
-                                       error_msg_and_die("multiple -c arguments\n");
+                                       error_msg_and_die("multiple -c arguments");
                                local_pending_command = xstrdup(argv[optind]);
                                optind++;
                                argv = argv+optind;
index 1690326976ff52d5637adbcd56523b24b286fa12..ed441d39406b790f488dd8f3d49982ceac168f42 100644 (file)
@@ -318,7 +318,7 @@ static void cmdedit_setwidth(int w, int redraw_flg)
                                input_backward();
                }
        } else {
-               error_msg("\n*** Error: minimum screen width is %d\n", cmdedit_termw);
+               error_msg("\n*** Error: minimum screen width is %d", cmdedit_termw);
        }
 }
 
index b3bdcc986a41648ed73c7812133cf5cfa2bc8a49..cc0d78687fdd301c4bc06ced330a9211ea2646c8 100644 (file)
@@ -321,13 +321,13 @@ static int builtin_fg_bg(struct child_prog *child)
        struct job *job=NULL;
        
        if (!child->argv[1] || child->argv[2]) {
-               error_msg("%s: exactly one argument is expected\n",
+               error_msg("%s: exactly one argument is expected",
                                child->argv[0]);
                return EXIT_FAILURE;
        }
 
        if (sscanf(child->argv[1], "%%%d", &jobNum) != 1) {
-               error_msg("%s: bad argument '%s'\n",
+               error_msg("%s: bad argument '%s'",
                                child->argv[0], child->argv[1]);
                return EXIT_FAILURE;
        }
@@ -339,7 +339,7 @@ static int builtin_fg_bg(struct child_prog *child)
        }
 
        if (!job) {
-               error_msg("%s: unknown job %d\n",
+               error_msg("%s: unknown job %d",
                                child->argv[0], jobNum);
                return EXIT_FAILURE;
        }
@@ -492,7 +492,7 @@ static int builtin_then(struct child_prog *child)
        debug_printf( "job=%p entering builtin_then ('%s')-- context=%d\n", cmd, charptr1, cmd->job_context);
        if (! (cmd->job_context & (IF_TRUE_CONTEXT|IF_FALSE_CONTEXT))) {
                shell_context = 0; /* Reset the shell's context on an error */
-               error_msg("%s `then'\n", syntax_err);
+               error_msg("%s `then'", syntax_err);
                return EXIT_FAILURE;
        }
 
@@ -520,7 +520,7 @@ static int builtin_else(struct child_prog *child)
 
        if (! (cmd->job_context & THEN_EXP_CONTEXT)) {
                shell_context = 0; /* Reset the shell's context on an error */
-               error_msg("%s `else'\n", syntax_err);
+               error_msg("%s `else'", syntax_err);
                return EXIT_FAILURE;
        }
        /* If the if result was TRUE, skip the 'else' stuff */
@@ -543,7 +543,7 @@ static int builtin_fi(struct child_prog *child)
        debug_printf( "job=%p entering builtin_fi ('%s')-- context=%d\n", cmd, "", cmd->job_context);
        if (! (cmd->job_context & (IF_TRUE_CONTEXT|IF_FALSE_CONTEXT))) {
                shell_context = 0; /* Reset the shell's context on an error */
-               error_msg("%s `fi'\n", syntax_err);
+               error_msg("%s `fi'", syntax_err);
                return EXIT_FAILURE;
        }
        /* Clear out the if and then context bits */
@@ -748,7 +748,7 @@ static int setup_redirects(struct child_prog *prog, int squirrel[])
                if (openfd < 0) {
                        /* this could get lost if stderr has been redirected, but
                           bash and ash both lose it as well (though zsh doesn't!) */
-                       error_msg("error opening %s: %s\n", redir->filename,
+                       error_msg("error opening %s: %s", redir->filename,
                                        strerror(errno));
                        return 1;
                }
@@ -960,7 +960,7 @@ static void expand_argument(struct child_prog *prog, int *argcPtr,
        if (strpbrk(prog->argv[argc_l - 1],"*[]?")!= NULL){
                rc = glob(prog->argv[argc_l - 1], flags, NULL, &prog->glob_result);
                if (rc == GLOB_NOSPACE) {
-                       error_msg("out of space during glob operation\n");
+                       error_msg("out of space during glob operation");
                        return;
                } else if (rc == GLOB_NOMATCH ||
                           (!rc && (prog->glob_result.gl_pathc - i) == 1 &&
@@ -1068,7 +1068,7 @@ static int parse_command(char **command_ptr, struct job *job, int *inbg)
                        if (*src == '\\') {
                                src++;
                                if (!*src) {
-                                       error_msg("character expected after \\\n");
+                                       error_msg("character expected after \\");
                                        free_job(job);
                                        return 1;
                                }
@@ -1152,7 +1152,7 @@ static int parse_command(char **command_ptr, struct job *job, int *inbg)
                                        chptr++;
 
                                if (!*chptr) {
-                                       error_msg("file name expected after %c\n", *src);
+                                       error_msg("file name expected after %c", *src);
                                        free_job(job);
                                        job->num_progs=0;
                                        return 1;
@@ -1171,7 +1171,7 @@ static int parse_command(char **command_ptr, struct job *job, int *inbg)
                                if (*prog->argv[argc_l])
                                        argc_l++;
                                if (!argc_l) {
-                                       error_msg("empty command in pipe\n");
+                                       error_msg("empty command in pipe");
                                        free_job(job);
                                        job->num_progs=0;
                                        return 1;
@@ -1199,7 +1199,7 @@ static int parse_command(char **command_ptr, struct job *job, int *inbg)
                                        src++;
 
                                if (!*src) {
-                                       error_msg("empty command in pipe\n");
+                                       error_msg("empty command in pipe");
                                        free_job(job);
                                        job->num_progs=0;
                                        return 1;
@@ -1307,7 +1307,7 @@ static int parse_command(char **command_ptr, struct job *job, int *inbg)
                                        printf("erik: found a continue char at EOL...\n");
                                        command = (char *) xcalloc(BUFSIZ, sizeof(char));
                                        if (get_command(input, command)) {
-                                               error_msg("character expected after \\\n");
+                                               error_msg("character expected after \\");
                                                free(command);
                                                free_job(job);
                                                return 1;
@@ -1323,7 +1323,7 @@ static int parse_command(char **command_ptr, struct job *job, int *inbg)
                                        free(command);
                                        break;
 #else
-                                       error_msg("character expected after \\\n");
+                                       error_msg("character expected after \\");
                                        free(command);
                                        free_job(job);
                                        return 1;
@@ -1738,7 +1738,7 @@ int shell_main(int argc_l, char **argv_l)
                        case 'c':
                                input = NULL;
                                if (local_pending_command != 0)
-                                       error_msg_and_die("multiple -c arguments\n");
+                                       error_msg_and_die("multiple -c arguments");
                                local_pending_command = xstrdup(argv[optind]);
                                optind++;
                                argv = argv+optind;
index 8a9134ca0075342a8066654ed441da594d770395..74f6ec36ebad76a46c8a655c8ffdb620d9b01efc 100644 (file)
@@ -95,7 +95,7 @@ extern int swap_on_off_main(int argc, char **argv)
                                        struct stat statBuf;
 
                                        if (stat("/etc/fstab", &statBuf) < 0)
-                                               error_msg_and_die("/etc/fstab file missing\n");
+                                               error_msg_and_die("/etc/fstab file missing");
                                }
                                do_em_all();
                                break;
index 1ab868d75f86cd7934fb768ddd009259b21c9c2a..85c63b8a5a13a57306fccdc53225204c27b68329 100644 (file)
@@ -87,14 +87,14 @@ static int pencode(char *s)
                *s = '\0';
                fac = decode(save, facilitynames);
                if (fac < 0)
-                       error_msg_and_die("unknown facility name: %s\n", save);
+                       error_msg_and_die("unknown facility name: %s", save);
                *s++ = '.';
        } else {
                s = save;
        }
        lev = decode(s, prioritynames);
        if (lev < 0)
-               error_msg_and_die("unknown priority name: %s\n", save);
+               error_msg_and_die("unknown priority name: %s", save);
        return ((lev & LOG_PRIMASK) | (fac & LOG_FACMASK));
 }
 
index 8eb74c69f3353d9b24634aad156babb38d34511f..7bd4bdcb2a6bd281cf005d757e2796e2340fea05 100644 (file)
@@ -182,7 +182,7 @@ static const int IOV_COUNT = 2;
 
                if ( -1 == writev(remotefd,iov, IOV_COUNT)){
                        error_msg_and_die("syslogd: cannot write to remote file handle on" 
-                                       "%s:%d\n",RemoteHost,RemotePort);
+                                       "%s:%d",RemoteHost,RemotePort);
                }
        }
        if (local_logging == TRUE)
@@ -264,13 +264,13 @@ static void init_RemoteLog (void){
   remotefd = socket(AF_INET, SOCK_DGRAM, 0);
 
   if (remotefd < 0) {
-    error_msg_and_die("syslogd: cannot create socket\n");
+    error_msg_and_die("syslogd: cannot create socket");
   }
 
   hostinfo = (struct hostent *) gethostbyname(RemoteHost);
 
   if (!hostinfo) {
-    error_msg_and_die("syslogd: cannot resolve remote host name [%s]\n", RemoteHost);
+    error_msg_and_die("syslogd: cannot resolve remote host name [%s]", RemoteHost);
   }
 
   remoteaddr.sin_family = AF_INET;
@@ -282,7 +282,7 @@ static void init_RemoteLog (void){
      for future operations
   */
   if ( 0 != (connect(remotefd, (struct sockaddr *) &remoteaddr, len))){
-    error_msg_and_die("syslogd: cannot connect to remote host %s:%d\n", RemoteHost, RemotePort);
+    error_msg_and_die("syslogd: cannot connect to remote host %s:%d", RemoteHost, RemotePort);
   }
 
 }
index 8eb74c69f3353d9b24634aad156babb38d34511f..7bd4bdcb2a6bd281cf005d757e2796e2340fea05 100644 (file)
--- a/syslogd.c
+++ b/syslogd.c
@@ -182,7 +182,7 @@ static const int IOV_COUNT = 2;
 
                if ( -1 == writev(remotefd,iov, IOV_COUNT)){
                        error_msg_and_die("syslogd: cannot write to remote file handle on" 
-                                       "%s:%d\n",RemoteHost,RemotePort);
+                                       "%s:%d",RemoteHost,RemotePort);
                }
        }
        if (local_logging == TRUE)
@@ -264,13 +264,13 @@ static void init_RemoteLog (void){
   remotefd = socket(AF_INET, SOCK_DGRAM, 0);
 
   if (remotefd < 0) {
-    error_msg_and_die("syslogd: cannot create socket\n");
+    error_msg_and_die("syslogd: cannot create socket");
   }
 
   hostinfo = (struct hostent *) gethostbyname(RemoteHost);
 
   if (!hostinfo) {
-    error_msg_and_die("syslogd: cannot resolve remote host name [%s]\n", RemoteHost);
+    error_msg_and_die("syslogd: cannot resolve remote host name [%s]", RemoteHost);
   }
 
   remoteaddr.sin_family = AF_INET;
@@ -282,7 +282,7 @@ static void init_RemoteLog (void){
      for future operations
   */
   if ( 0 != (connect(remotefd, (struct sockaddr *) &remoteaddr, len))){
-    error_msg_and_die("syslogd: cannot connect to remote host %s:%d\n", RemoteHost, RemotePort);
+    error_msg_and_die("syslogd: cannot connect to remote host %s:%d", RemoteHost, RemotePort);
   }
 
 }
diff --git a/tar.c b/tar.c
index 3082914550a32672d10dcd8ed4270092be31219e..60744e8db91740256fc37398f8616375165305d6 100644 (file)
--- a/tar.c
+++ b/tar.c
@@ -165,10 +165,10 @@ extern int tar_unzip_init(int tarFd)
        signal(SIGCHLD, child_died);
 
        if (pipe(unzip_pipe)!=0)
-               error_msg_and_die("pipe error\n");
+               error_msg_and_die("pipe error");
 
        if ( (child_pid = fork()) == -1)
-               error_msg_and_die("fork failure\n");
+               error_msg_and_die("fork failure");
 
        if (child_pid==0) {
                /* child process */
@@ -259,7 +259,7 @@ extern int tar_main(int argc, char **argv)
                                break;
                        case 'f':
                                if (*tarName != '-')
-                                       error_msg_and_die( "Only one 'f' option allowed\n");
+                                       error_msg_and_die( "Only one 'f' option allowed");
                                tarName = optarg;
                                break;
 #if defined BB_FEATURE_TAR_EXCLUDE
@@ -294,11 +294,11 @@ extern int tar_main(int argc, char **argv)
         */
        if (createFlag == TRUE) {
 #ifndef BB_FEATURE_TAR_CREATE
-               error_msg_and_die( "This version of tar was not compiled with tar creation support.\n");
+               error_msg_and_die( "This version of tar was not compiled with tar creation support.");
 #else
 #ifdef BB_FEATURE_TAR_GZIP
                if (unzipFlag==TRUE)
-                       error_msg_and_die("Creation of compressed not internally support by tar, pipe to busybox gunzip\n");
+                       error_msg_and_die("Creation of compressed not internally support by tar, pipe to busybox gunzip");
 #endif
                status = writeTarFile(tarName, verboseFlag, argv + optind, excludeList);
 #endif
@@ -330,7 +330,7 @@ extern int tar_main(int argc, char **argv)
                return EXIT_FAILURE;
 
   flagError:
-       error_msg_and_die( "Exactly one of 'c', 'x' or 't' must be specified\n");
+       error_msg_and_die( "Exactly one of 'c', 'x' or 't' must be specified");
 }
                                        
 static void
@@ -383,7 +383,7 @@ tarExtractRegularFile(TarInfo *header, int extractFlag, int tostdoutFlag)
                }
                if ( (readSize = full_read(header->tarFd, buffer, readSize)) <= 0 ) {
                        /* Tarball seems to have a problem */
-                       error_msg("Unexpected EOF in archive\n"); 
+                       error_msg("Unexpected EOF in archive"); 
                        return( FALSE);
                }
                if ( readSize < writeSize )
@@ -476,7 +476,7 @@ tarExtractSymLink(TarInfo *header, int extractFlag, int tostdoutFlag)
        /* Do not change permissions or date on symlink,
         * since it changes the pointed to file instead.  duh. */
 #else
-       error_msg("%s: Cannot create symlink to '%s': %s\n", 
+       error_msg("%s: Cannot create symlink to '%s': %s", 
                        header->name, header->linkname, 
                        "symlinks not supported"); 
 #endif
@@ -543,7 +543,7 @@ readTarHeader(struct TarHeader *rawHeader, struct TarInfo *header)
                        ++*(header->name);
 
                if (alreadyWarned == FALSE) {
-                       error_msg("Removing leading '/' from member names\n");
+                       error_msg("Removing leading '/' from member names");
                        alreadyWarned = TRUE;
                }
        }
@@ -644,7 +644,7 @@ extern int readTarFile(int tarFd, int extractFlag, int listFlag,
                                goto endgame;
                        } else {
                                errorFlag=TRUE;
-                               error_msg("Bad tar header, skipping\n");
+                               error_msg("Bad tar header, skipping");
                                continue;
                        }
                }
@@ -791,7 +791,7 @@ extern int readTarFile(int tarFd, int extractFlag, int listFlag,
                                break;
 #endif
                        default:
-                               error_msg("Unknown file type '%c' in tar file\n", header.type);
+                               error_msg("Unknown file type '%c' in tar file", header.type);
                                close( tarFd);
                                return( FALSE);
                }
@@ -803,7 +803,7 @@ extern int readTarFile(int tarFd, int extractFlag, int listFlag,
                return ( FALSE);
        }
        else if (errorFlag==TRUE) {
-               error_msg( "Error exit delayed from previous errors\n");
+               error_msg( "Error exit delayed from previous errors");
                return( FALSE);
        } else 
                return( status);
@@ -813,7 +813,7 @@ endgame:
        close( tarFd);
        if ( *(header.name) == '\0' ) {
                if (errorFlag==TRUE)
-                       error_msg( "Error exit delayed from previous errors\n");
+                       error_msg( "Error exit delayed from previous errors");
                else
                        return( TRUE);
        } 
@@ -1002,7 +1002,7 @@ writeTarHeader(struct TarBallInfo *tbInfo, const char *header_name,
                header.typeflag  = REGTYPE;
                putOctal(header.size, sizeof(header.size), statbuf->st_size);
        } else {
-               error_msg("%s: Unknown file type\n", real_name);
+               error_msg("%s: Unknown file type", real_name);
                return ( FALSE);
        }
 
@@ -1061,7 +1061,7 @@ static int writeFileToTarball(const char *fileName, struct stat *statbuf, void*
 
        /* It is against the rules to archive a socket */
        if (S_ISSOCK(statbuf->st_mode)) {
-               error_msg("%s: socket ignored\n", fileName);
+               error_msg("%s: socket ignored", fileName);
                return( TRUE);
        }
 
@@ -1070,7 +1070,7 @@ static int writeFileToTarball(const char *fileName, struct stat *statbuf, void*
         * the new tarball */
        if (tbInfo->statBuf.st_dev == statbuf->st_dev &&
                        tbInfo->statBuf.st_ino == statbuf->st_ino) {
-               error_msg("%s: file is the archive; skipping\n", fileName);
+               error_msg("%s: file is the archive; skipping", fileName);
                return( TRUE);
        }
 
@@ -1078,7 +1078,7 @@ static int writeFileToTarball(const char *fileName, struct stat *statbuf, void*
        while (header_name[0] == '/') {
                static int alreadyWarned=FALSE;
                if (alreadyWarned==FALSE) {
-                       error_msg("Removing leading '/' from member names\n");
+                       error_msg("Removing leading '/' from member names");
                        alreadyWarned=TRUE;
                }
                header_name++;
@@ -1111,7 +1111,7 @@ static int writeFileToTarball(const char *fileName, struct stat *statbuf, void*
 
                /* open the file we want to archive, and make sure all is well */
                if ((inputFileFd = open(fileName, O_RDONLY)) < 0) {
-                       error_msg("%s: Cannot open: %s\n", fileName, strerror(errno));
+                       error_msg("%s: Cannot open: %s", fileName, strerror(errno));
                        return( FALSE);
                }
                
@@ -1150,7 +1150,7 @@ static int writeTarFile(const char* tarName, int verboseFlag, char **argv,
 
        /* Make sure there is at least one file to tar up.  */
        if (*argv == NULL)
-               error_msg_and_die("Cowardly refusing to create an empty archive\n");
+               error_msg_and_die("Cowardly refusing to create an empty archive");
 
        /* Open the tar file for writing.  */
        if (!strcmp(tarName, "-"))
@@ -1193,7 +1193,7 @@ static int writeTarFile(const char* tarName, int verboseFlag, char **argv,
        /* Hang up the tools, close up shop, head home */
        close(tarFd);
        if (errorFlag == TRUE) {
-               error_msg("Error exit delayed from previous errors\n");
+               error_msg("Error exit delayed from previous errors");
                freeHardLinkInfo(&tbInfo.hlInfoHead);
                return(FALSE);
        }
index 8f7bbf29b8fac1f4571cecef86acc6447d9073ff..b08effed7d4078e0ab101448452401b4dd1179b1 100644 (file)
--- a/telnet.c
+++ b/telnet.c
@@ -584,7 +584,7 @@ static int getport(char * p)
 
        if ((unsigned)(port - 1 ) > 65534)
        {
-               error_msg_and_die("%s: bad port number\n", p);
+               error_msg_and_die("%s: bad port number", p);
        }
        return port;
 }
@@ -596,7 +596,7 @@ static struct in_addr getserver(char * host)
        struct hostent * he;
        if ((he = gethostbyname(host)) == NULL)
        {
-               error_msg_and_die("%s: Unknown host\n", host);
+               error_msg_and_die("%s: Unknown host", host);
        }
        memcpy(&addr, he->h_addr, sizeof addr);
 
diff --git a/test.c b/test.c
index ba6feb033e879c616af48d586d29b03ffd4ce7e0..6439e3a8ae94f2d6edbea90d99273fc7e4854ba3 100644 (file)
--- a/test.c
+++ b/test.c
@@ -184,7 +184,7 @@ test_main(int argc, char** argv)
 
        if (strcmp(applet_name, "[") == 0) {
                if (strcmp(argv[--argc], "]"))
-                       error_msg_and_die("missing ]\n");
+                       error_msg_and_die("missing ]");
                argv[argc] = NULL;
        }
        /* Implement special cases from POSIX.2, section 4.62.4 */
@@ -233,9 +233,9 @@ syntax(op, msg)
        char    *msg;
 {
        if (op && *op)
-               error_msg_and_die("%s: %s\n", op, msg);
+               error_msg_and_die("%s: %s", op, msg);
        else
-               error_msg_and_die("%s\n", msg);
+               error_msg_and_die("%s", msg);
 }
 
 static int
@@ -470,13 +470,13 @@ getn(s)
        r = strtol(s, &p, 10);
 
        if (errno != 0)
-         error_msg_and_die("%s: out of range\n", s);
+         error_msg_and_die("%s: out of range", s);
 
        while (isspace(*p))
          p++;
        
        if (*p)
-         error_msg_and_die("%s: bad number\n", s);
+         error_msg_and_die("%s: bad number", s);
 
        return (int) r;
 }
diff --git a/tr.c b/tr.c
index 2717a92db74f11bbd2834db1bfa9f18042c2b1ce..36f29de446ce2cbeb91160830d8bb15ab409214d 100644 (file)
--- a/tr.c
+++ b/tr.c
@@ -186,7 +186,7 @@ extern int tr_main(int argc, char **argv)
                        input_length = complement(input, input_length);
                if (argv[index] != NULL) {
                        if (*argv[index] == '\0')
-                               error_msg_and_die("STRING2 cannot be empty\n");
+                               error_msg_and_die("STRING2 cannot be empty");
                        output_length = expand(argv[index], output);
                        map(input, input_length, output, output_length);
                }
index 3772d55f09d8d943e47b32401d2891e55c3759c7..39842d2324b1dfa363fdda756797eef65d466b43 100644 (file)
--- a/umount.c
+++ b/umount.c
@@ -81,7 +81,7 @@ void mtab_read(void)
                return;
 
        if ((fp = setmntent(mtab_file, "r")) == NULL) {
-               error_msg("Cannot open %s\n", mtab_file);
+               error_msg("Cannot open %s", mtab_file);
                return;
        }
        while ((e = getmntent(fp))) {
@@ -181,7 +181,7 @@ static int do_umount(const char *name, int useMtab)
        if (status != 0 && doForce == TRUE) {
                status = umount2(blockDevice, MNT_FORCE);
                if (status != 0) {
-                       error_msg_and_die("forced umount of %s failed!\n", blockDevice);
+                       error_msg_and_die("forced umount of %s failed!", blockDevice);
                }
        }
 #endif
@@ -189,9 +189,9 @@ static int do_umount(const char *name, int useMtab)
                status = mount(blockDevice, name, NULL,
                                           MS_MGC_VAL | MS_REMOUNT | MS_RDONLY, NULL);
                if (status == 0) {
-                       error_msg("%s busy - remounted read-only\n", blockDevice);
+                       error_msg("%s busy - remounted read-only", blockDevice);
                } else {
-                       error_msg("Cannot remount %s read-only\n", blockDevice);
+                       error_msg("Cannot remount %s read-only", blockDevice);
                }
        }
        if (status == 0) {
index 637896bedc6970cbda45e1977f14aae52de3804c..f20c284aa3c1e5f9ce11e2c17efe662be2de9695 100644 (file)
@@ -284,7 +284,7 @@ static int readmode(struct fb_var_screeninfo *base, const char *fn,
                }
        }
 #else
-       error_msg( "mode reading not compiled in\n");
+       error_msg( "mode reading not compiled in");
 #endif
        return 0;
 }
@@ -434,7 +434,7 @@ extern int fbset_main(int argc, char **argv)
                perror_msg_and_die("fbset(ioctl)");
        if (g_options & OPT_READMODE) {
                if (!readmode(&var, modefile, mode)) {
-                       error_msg("Unknown video mode `%s'\n", mode);
+                       error_msg("Unknown video mode `%s'", mode);
                        return EXIT_FAILURE;
                }
        }
index 18841ec563b6c9fa14fb2f2b58c1decbad8eff0e..9d762200606d243af355d4839fb24de99feeda6c 100644 (file)
@@ -290,7 +290,7 @@ static void show_usage(void)
 
 static void die(const char *str)
 {
-       error_msg("%s\n", str);
+       error_msg("%s", str);
        leave(8);
 }
 
index ff55a3e3ce23a6810522aca3f4f36edb7d7273e5..625263184321b25c510d8da57913b97fcc44e59a 100644 (file)
@@ -258,7 +258,7 @@ void add_long_options(char *options)
                                         arg_opt=required_argument;
                                 }
                                 if (strlen(tokptr) == 0)
-                                        error_msg("empty long option after -l or --long argument\n");
+                                        error_msg("empty long option after -l or --long argument");
                         }
                         add_longopt(tokptr,arg_opt);
                 }
@@ -277,7 +277,7 @@ void set_shell(const char *new_shell)
         else if (!strcmp(new_shell,"csh"))
                 shell=TCSH;
         else
-                error_msg("unknown shell after -s or --shell argument\n");
+                error_msg("unknown shell after -s or --shell argument");
 }
 
 
@@ -326,7 +326,7 @@ int getopt_main(int argc, char *argv[])
                         printf(" --\n");
                         exit(0);
                 } else
-                        error_msg_and_die("missing optstring argument\n");
+                        error_msg_and_die("missing optstring argument");
         }
 
         if (argv[1][0] != '-' || compatible) {
@@ -377,7 +377,7 @@ int getopt_main(int argc, char *argv[])
 
         if (!optstr) {
                 if (optind >= argc)
-                        error_msg_and_die("missing optstring argument\n");
+                        error_msg_and_die("missing optstring argument");
                 else {
                         optstr=xmalloc(strlen(argv[optind])+1);
                         strcpy(optstr,argv[optind]);
index 21965d3b1c0adc77bc19dec7354b8bd1480300ee..a2b6d8a6e5547dc196627bac05aee12a21b88a79 100644 (file)
@@ -279,7 +279,7 @@ static void check_mount(void)
        if (!mnt)
                return;
 
-       error_msg_and_die("%s is mounted; will not make a filesystem here!\n", device_name);
+       error_msg_and_die("%s is mounted; will not make a filesystem here!", device_name);
 }
 
 static long valid_offset(int fd, int offset)
@@ -336,28 +336,28 @@ static void write_tables(void)
        Super.s_state &= ~MINIX_ERROR_FS;
 
        if (lseek(DEV, 0, SEEK_SET))
-               error_msg_and_die("seek to boot block failed in write_tables\n");
+               error_msg_and_die("seek to boot block failed in write_tables");
        if (512 != write(DEV, boot_block_buffer, 512))
-               error_msg_and_die("unable to clear boot sector\n");
+               error_msg_and_die("unable to clear boot sector");
        if (BLOCK_SIZE != lseek(DEV, BLOCK_SIZE, SEEK_SET))
-               error_msg_and_die("seek failed in write_tables\n");
+               error_msg_and_die("seek failed in write_tables");
        if (BLOCK_SIZE != write(DEV, super_block_buffer, BLOCK_SIZE))
-               error_msg_and_die("unable to write super-block\n");
+               error_msg_and_die("unable to write super-block");
        if (IMAPS * BLOCK_SIZE != write(DEV, inode_map, IMAPS * BLOCK_SIZE))
-               error_msg_and_die("unable to write inode map\n");
+               error_msg_and_die("unable to write inode map");
        if (ZMAPS * BLOCK_SIZE != write(DEV, zone_map, ZMAPS * BLOCK_SIZE))
-               error_msg_and_die("unable to write zone map\n");
+               error_msg_and_die("unable to write zone map");
        if (INODE_BUFFER_SIZE != write(DEV, inode_buffer, INODE_BUFFER_SIZE))
-               error_msg_and_die("unable to write inodes\n");
+               error_msg_and_die("unable to write inodes");
 
 }
 
 static void write_block(int blk, char *buffer)
 {
        if (blk * BLOCK_SIZE != lseek(DEV, blk * BLOCK_SIZE, SEEK_SET))
-               error_msg_and_die("seek failed in write_block\n");
+               error_msg_and_die("seek failed in write_block");
        if (BLOCK_SIZE != write(DEV, buffer, BLOCK_SIZE))
-               error_msg_and_die("write failed in write_block\n");
+               error_msg_and_die("write failed in write_block");
 }
 
 static int get_free_block(void)
@@ -365,7 +365,7 @@ static int get_free_block(void)
        int blk;
 
        if (used_good_blocks + 1 >= MAX_GOOD_BLOCKS)
-               error_msg_and_die("too many bad blocks\n");
+               error_msg_and_die("too many bad blocks");
        if (used_good_blocks)
                blk = good_blocks_table[used_good_blocks - 1] + 1;
        else
@@ -373,7 +373,7 @@ static int get_free_block(void)
        while (blk < ZONES && zone_in_use(blk))
                blk++;
        if (blk >= ZONES)
-               error_msg_and_die("not enough good blocks\n");
+               error_msg_and_die("not enough good blocks");
        good_blocks_table[used_good_blocks] = blk;
        used_good_blocks++;
        return blk;
@@ -439,7 +439,7 @@ static void make_bad_inode(void)
                                goto end_bad;
                }
        }
-       error_msg_and_die("too many bad blocks\n");
+       error_msg_and_die("too many bad blocks");
   end_bad:
        if (ind)
                write_block(ind, (char *) ind_block);
@@ -489,7 +489,7 @@ static void make_bad_inode2(void)
                }
        }
        /* Could make triple indirect block here */
-       error_msg_and_die("too many bad blocks\n");
+       error_msg_and_die("too many bad blocks");
   end_bad:
        if (ind)
                write_block(ind, (char *) ind_block);
@@ -590,7 +590,7 @@ static void setup_tables(void)
         * /sbin/mkfs.minix -i 200 test.fs
         * */
        if (i >= 999) {
-               error_msg_and_die("unable to allocate buffers for maps\n");
+               error_msg_and_die("unable to allocate buffers for maps");
        }
        FIRSTZONE = NORM_FIRSTZONE;
        inode_map = xmalloc(IMAPS * BLOCK_SIZE);
@@ -621,7 +621,7 @@ long do_check(char *buffer, int try, unsigned int current_block)
        /* Seek to the correct loc. */
        if (lseek(DEV, current_block * BLOCK_SIZE, SEEK_SET) !=
                current_block * BLOCK_SIZE) {
-               error_msg_and_die("seek failed during testing of blocks\n");
+               error_msg_and_die("seek failed during testing of blocks");
        }
 
 
@@ -661,7 +661,7 @@ static void check_blocks(void)
        while (currently_testing < ZONES) {
                if (lseek(DEV, currently_testing * BLOCK_SIZE, SEEK_SET) !=
                        currently_testing * BLOCK_SIZE)
-                       error_msg_and_die("seek failed in check_blocks\n");
+                       error_msg_and_die("seek failed in check_blocks");
                try = TEST_BUFFER_BLOCKS;
                if (currently_testing + try > ZONES)
                        try = ZONES - currently_testing;
@@ -670,7 +670,7 @@ static void check_blocks(void)
                if (got == try)
                        continue;
                if (currently_testing < FIRSTZONE)
-                       error_msg_and_die("bad blocks before data-area: cannot make fs\n");
+                       error_msg_and_die("bad blocks before data-area: cannot make fs");
                mark_zone(currently_testing);
                badblocks++;
                currently_testing++;
@@ -690,7 +690,7 @@ char *filename;
 
        listfile = fopen(filename, "r");
        if (listfile == (FILE *) NULL) {
-               error_msg_and_die("can't open file of bad blocks\n");
+               error_msg_and_die("can't open file of bad blocks");
        }
        while (!feof(listfile)) {
                fscanf(listfile, "%ld\n", &blockno);
@@ -712,10 +712,10 @@ extern int mkfs_minix_main(int argc, char **argv)
        int stopIt=FALSE;
 
        if (INODE_SIZE * MINIX_INODES_PER_BLOCK != BLOCK_SIZE)
-               error_msg_and_die("bad inode size\n");
+               error_msg_and_die("bad inode size");
 #ifdef BB_FEATURE_MINIX2
        if (INODE_SIZE2 * MINIX2_INODES_PER_BLOCK != BLOCK_SIZE)
-               error_msg_and_die("bad inode size\n");
+               error_msg_and_die("bad inode size");
 #endif
        
        /* Parse options */
@@ -781,7 +781,7 @@ extern int mkfs_minix_main(int argc, char **argv)
 #ifdef BB_FEATURE_MINIX2
                                                version2 = 1;
 #else
-                                               error_msg("%s: not compiled with minix v2 support\n",
+                                               error_msg("%s: not compiled with minix v2 support",
                                                                device_name);
                                                exit(-1);
 #endif
@@ -832,13 +832,13 @@ goodbye:
        strcpy(tmp + 2, ".badblocks");
        DEV = open(device_name, O_RDWR);
        if (DEV < 0)
-               error_msg_and_die("unable to open %s\n", device_name);
+               error_msg_and_die("unable to open %s", device_name);
        if (fstat(DEV, &statbuf) < 0)
-               error_msg_and_die("unable to stat %s\n", device_name);
+               error_msg_and_die("unable to stat %s", device_name);
        if (!S_ISBLK(statbuf.st_mode))
                check = 0;
        else if (statbuf.st_rdev == 0x0300 || statbuf.st_rdev == 0x0340)
-               error_msg_and_die("will not try to make filesystem on '%s'\n", device_name);
+               error_msg_and_die("will not try to make filesystem on '%s'", device_name);
        setup_tables();
        if (check)
                check_blocks();
index 8a3c900f31d02a579065c89f712ddc9d84830fd9..7d690ad99b5e7c6b18626211e5ed638d1cbd89e5 100644 (file)
@@ -87,7 +87,7 @@ static void init_signature_page()
 
 #ifdef PAGE_SIZE
        if (pagesize != PAGE_SIZE)
-               error_msg("Assuming pages of size %d\n", pagesize);
+               error_msg("Assuming pages of size %d", pagesize);
 #endif
        signature_page = (int *) xmalloc(pagesize);
        memset(signature_page, 0, pagesize);
@@ -185,7 +185,7 @@ static void page_bad(int page)
                bit_test_and_clear(signature_page, page);
        else {
                if (badpages == MAX_BADPAGES)
-                       error_msg_and_die("too many bad pages\n");
+                       error_msg_and_die("too many bad pages");
                p->badpages[badpages] = page;
        }
        badpages++;
@@ -206,7 +206,7 @@ static void check_blocks(void)
                }
                if (do_seek && lseek(DEV, current_page * pagesize, SEEK_SET) !=
                        current_page * pagesize)
-                       error_msg_and_die("seek failed in check_blocks\n");
+                       error_msg_and_die("seek failed in check_blocks");
                if ((do_seek = (pagesize != read(DEV, buffer, pagesize)))) {
                        page_bad(current_page++);
                        continue;
@@ -307,14 +307,14 @@ int mkswap_main(int argc, char **argv)
                }
        }
        if (!device_name) {
-               error_msg("error: Nowhere to set up swap on?\n");
+               error_msg("error: Nowhere to set up swap on?");
                usage(mkswap_usage);
        }
        sz = get_size(device_name);
        if (!PAGES) {
                PAGES = sz;
        } else if (PAGES > sz && !force) {
-               error_msg("error: size %ld is larger than device size %d\n",
+               error_msg("error: size %ld is larger than device size %d",
                                PAGES * (pagesize / 1024), sz * (pagesize / 1024));
                return EXIT_FAILURE;
        }
@@ -330,11 +330,11 @@ int mkswap_main(int argc, char **argv)
                        version = 1;
        }
        if (version != 0 && version != 1) {
-               error_msg("error: unknown version %d\n", version);
+               error_msg("error: unknown version %d", version);
                usage(mkswap_usage);
        }
        if (PAGES < 10) {
-               error_msg("error: swap area needs to be at least %ldkB\n",
+               error_msg("error: swap area needs to be at least %ldkB",
                                (long) (10 * pagesize / 1024));
                usage(mkswap_usage);
        }
@@ -353,7 +353,7 @@ int mkswap_main(int argc, char **argv)
 #endif
        if (PAGES > maxpages) {
                PAGES = maxpages;
-               error_msg("warning: truncating swap area to %ldkB\n",
+               error_msg("warning: truncating swap area to %ldkB",
                                PAGES * pagesize / 1024);
        }
 
@@ -363,7 +363,7 @@ int mkswap_main(int argc, char **argv)
        if (!S_ISBLK(statbuf.st_mode))
                check = 0;
        else if (statbuf.st_rdev == 0x0300 || statbuf.st_rdev == 0x0340)
-               error_msg_and_die("Will not try to make swapdevice on '%s'\n", device_name);
+               error_msg_and_die("Will not try to make swapdevice on '%s'", device_name);
 
 #ifdef __sparc__
        if (!force && version == 0) {
@@ -372,7 +372,7 @@ int mkswap_main(int argc, char **argv)
                unsigned short *q, sum;
 
                if (read(DEV, buffer, 512) != 512)
-                       error_msg_and_die("fatal: first page unreadable\n");
+                       error_msg_and_die("fatal: first page unreadable");
                if (buffer[508] == 0xDA && buffer[509] == 0xBE) {
                        q = (unsigned short *) (buffer + 510);
                        for (sum = 0; q >= (unsigned short *) buffer;)
@@ -381,7 +381,7 @@ int mkswap_main(int argc, char **argv)
                                error_msg("Device '%s' contains a valid Sun disklabel.\n"
 "This probably means creating v0 swap would destroy your partition table\n"
 "No swap created. If you really want to create swap v0 on that device, use\n"
-"the -f option to force it.\n", device_name);
+"the -f option to force it.", device_name);
                                return EXIT_FAILURE;
                        }
                }
@@ -391,7 +391,7 @@ int mkswap_main(int argc, char **argv)
        if (version == 0 || check)
                check_blocks();
        if (version == 0 && !bit_test_and_clear(signature_page, 0))
-               error_msg_and_die("fatal: first page unreadable\n");
+               error_msg_and_die("fatal: first page unreadable");
        if (version == 1) {
                p->version = version;
                p->last_page = PAGES - 1;
@@ -400,23 +400,23 @@ int mkswap_main(int argc, char **argv)
 
        goodpages = PAGES - badpages - 1;
        if (goodpages <= 0)
-               error_msg_and_die("Unable to set up swap-space: unreadable\n");
+               error_msg_and_die("Unable to set up swap-space: unreadable");
        printf("Setting up swapspace version %d, size = %ld bytes\n",
                   version, (long) (goodpages * pagesize));
        write_signature((version == 0) ? "SWAP-SPACE" : "SWAPSPACE2");
 
        offset = ((version == 0) ? 0 : 1024);
        if (lseek(DEV, offset, SEEK_SET) != offset)
-               error_msg_and_die("unable to rewind swap-device\n");
+               error_msg_and_die("unable to rewind swap-device");
        if (write(DEV, (char *) signature_page + offset, pagesize - offset)
                != pagesize - offset)
-               error_msg_and_die("unable to write signature page\n");
+               error_msg_and_die("unable to write signature page");
 
        /*
         * A subsequent swapon() will fail if the signature
         * is not actually on disk. (This is a kernel bug.)
         */
        if (fsync(DEV))
-               error_msg_and_die("fsync failed\n");
+               error_msg_and_die("fsync failed");
        return EXIT_SUCCESS;
 }
index f78786ebc012e73a288a110350f42fdd6d047939..b571e5035c658a3edd2ad20c8a271a02ab77451c 100644 (file)
@@ -132,20 +132,20 @@ do_mount(char *specialfile, char *dir, char *filesystemtype,
 
                        specialfile = find_unused_loop_device();
                        if (specialfile == NULL) {
-                               error_msg_and_die("Could not find a spare loop device\n");
+                               error_msg_and_die("Could not find a spare loop device");
                        }
                        if (set_loop(specialfile, lofile, 0, &loro)) {
-                               error_msg_and_die("Could not setup loop device\n");
+                               error_msg_and_die("Could not setup loop device");
                        }
                        if (!(flags & MS_RDONLY) && loro) {     /* loop is ro, but wanted rw */
-                               error_msg("WARNING: loop device is read-only\n");
+                               error_msg("WARNING: loop device is read-only");
                                flags &= ~MS_RDONLY;
                        }
                }
 #endif
                status = mount(specialfile, dir, filesystemtype, flags, string_flags);
                if (errno == EROFS) {
-                       error_msg("%s is write-protected, mounting read-only\n", specialfile);
+                       error_msg("%s is write-protected, mounting read-only", specialfile);
                        status = mount(specialfile, dir, filesystemtype, flags |= MS_RDONLY, string_flags);
                }
        }
@@ -171,7 +171,7 @@ do_mount(char *specialfile, char *dir, char *filesystemtype,
 #endif
 
        if (errno == EPERM) {
-               error_msg_and_die("permission denied. Are you root?\n");
+               error_msg_and_die("permission denied. Are you root?");
        }
 
        return (FALSE);
index b260a885f3faa2eb2dff475d6910701997423562..397858b7196515a4a5d7f7d4ada25a418a4d6905 100644 (file)
@@ -307,7 +307,7 @@ int nfsmount(const char *spec, const char *node, int *flags,
        msock = fsock = -1;
        mclient = NULL;
        if (strlen(spec) >= sizeof(hostdir)) {
-               error_msg("excessively long host:dir argument\n");
+               error_msg("excessively long host:dir argument");
                goto fail;
        }
        strcpy(hostdir, spec);
@@ -319,10 +319,10 @@ int nfsmount(const char *spec, const char *node, int *flags,
                   until they can be fully supported. (mack@sgi.com) */
                if ((s = strchr(hostdir, ','))) {
                        *s = '\0';
-                       error_msg("warning: multiple hostnames not supported\n");
+                       error_msg("warning: multiple hostnames not supported");
                }
        } else {
-               error_msg("directory to mount not in host:dir format\n");
+               error_msg("directory to mount not in host:dir format");
                goto fail;
        }
 
@@ -332,11 +332,11 @@ int nfsmount(const char *spec, const char *node, int *flags,
 #endif
        {
                if ((hp = gethostbyname(hostname)) == NULL) {
-                       error_msg("can't get address for %s\n", hostname);
+                       error_msg("can't get address for %s", hostname);
                        goto fail;
                } else {
                        if (hp->h_length > sizeof(struct in_addr)) {
-                               error_msg("got bad hp->h_length\n");
+                               error_msg("got bad hp->h_length");
                                hp->h_length = sizeof(struct in_addr);
                        }
                        memcpy(&server_addr.sin_addr,
@@ -353,7 +353,7 @@ int nfsmount(const char *spec, const char *node, int *flags,
        if (!old_opts)
                old_opts = "";
        if (strlen(old_opts) + strlen(s) + 10 >= sizeof(new_opts)) {
-               error_msg("excessively long option argument\n");
+               error_msg("excessively long option argument");
                goto fail;
        }
        sprintf(new_opts, "%s%saddr=%s",
@@ -513,11 +513,11 @@ int nfsmount(const char *spec, const char *node, int *flags,
                data.flags |= (nolock ? NFS_MOUNT_NONLM : 0);
 #endif
        if (nfsvers > MAX_NFSPROT) {
-               error_msg("NFSv%d not supported!\n", nfsvers);
+               error_msg("NFSv%d not supported!", nfsvers);
                return 0;
        }
        if (mountvers > MAX_NFSPROT) {
-               error_msg("NFSv%d not supported!\n", nfsvers);
+               error_msg("NFSv%d not supported!", nfsvers);
                return 0;
        }
        if (nfsvers && !mountvers)
@@ -577,11 +577,11 @@ int nfsmount(const char *spec, const char *node, int *flags,
            mount_server_addr.sin_addr.s_addr = inet_addr(hostname);
          } else {
                  if ((hp = gethostbyname(mounthost)) == NULL) {
-                         error_msg("can't get address for %s\n", hostname);
+                         error_msg("can't get address for %s", hostname);
                          goto fail;
                  } else {
                          if (hp->h_length > sizeof(struct in_addr)) {
-                                 error_msg("got bad hp->h_length?\n");
+                                 error_msg("got bad hp->h_length?");
                                  hp->h_length = sizeof(struct in_addr);
                          }
                          mount_server_addr.sin_family = AF_INET;
@@ -716,7 +716,7 @@ int nfsmount(const char *spec, const char *node, int *flags,
 
        if (nfsvers == 2) {
                if (status.nfsv2.fhs_status != 0) {
-                       error_msg("%s:%s failed, reason given by server: %s\n",
+                       error_msg("%s:%s failed, reason given by server: %s",
                                hostname, dirname,
                                nfs_strerror(status.nfsv2.fhs_status));
                        goto fail;
@@ -734,7 +734,7 @@ int nfsmount(const char *spec, const char *node, int *flags,
 #if NFS_MOUNT_VERSION >= 4
                fhandle3 *fhandle;
                if (status.nfsv3.fhs_status != 0) {
-                       error_msg("%s:%s failed, reason given by server: %s\n",
+                       error_msg("%s:%s failed, reason given by server: %s",
                                hostname, dirname,
                                nfs_strerror(status.nfsv3.fhs_status));
                        goto fail;
index 0ad339be8aa370de44135182d8f59db9a9db764c..d350be87724b0e46d39a368ad018669f7fec4056 100644 (file)
@@ -72,7 +72,7 @@ time_t askremotedate(char *host)
        }
        if (read(fd, (void *)&nett, 4) != 4) {  /* read time from server */
                close(fd);
-               error_msg("%s did not send the complete time\n", host);
+               error_msg("%s did not send the complete time", host);
        }
        close(fd);
 
index 8a9134ca0075342a8066654ed441da594d770395..74f6ec36ebad76a46c8a655c8ffdb620d9b01efc 100644 (file)
@@ -95,7 +95,7 @@ extern int swap_on_off_main(int argc, char **argv)
                                        struct stat statBuf;
 
                                        if (stat("/etc/fstab", &statBuf) < 0)
-                                               error_msg_and_die("/etc/fstab file missing\n");
+                                               error_msg_and_die("/etc/fstab file missing");
                                }
                                do_em_all();
                                break;
index 3772d55f09d8d943e47b32401d2891e55c3759c7..39842d2324b1dfa363fdda756797eef65d466b43 100644 (file)
@@ -81,7 +81,7 @@ void mtab_read(void)
                return;
 
        if ((fp = setmntent(mtab_file, "r")) == NULL) {
-               error_msg("Cannot open %s\n", mtab_file);
+               error_msg("Cannot open %s", mtab_file);
                return;
        }
        while ((e = getmntent(fp))) {
@@ -181,7 +181,7 @@ static int do_umount(const char *name, int useMtab)
        if (status != 0 && doForce == TRUE) {
                status = umount2(blockDevice, MNT_FORCE);
                if (status != 0) {
-                       error_msg_and_die("forced umount of %s failed!\n", blockDevice);
+                       error_msg_and_die("forced umount of %s failed!", blockDevice);
                }
        }
 #endif
@@ -189,9 +189,9 @@ static int do_umount(const char *name, int useMtab)
                status = mount(blockDevice, name, NULL,
                                           MS_MGC_VAL | MS_REMOUNT | MS_RDONLY, NULL);
                if (status == 0) {
-                       error_msg("%s busy - remounted read-only\n", blockDevice);
+                       error_msg("%s busy - remounted read-only", blockDevice);
                } else {
-                       error_msg("Cannot remount %s read-only\n", blockDevice);
+                       error_msg("Cannot remount %s read-only", blockDevice);
                }
        }
        if (status == 0) {
index 7ff0418c5c15f41dd5fe67d790c905b7e6c8be1c..31192693872f238c2200b6a87bc4e9766967b9d7 100644 (file)
--- a/utility.c
+++ b/utility.c
@@ -105,6 +105,7 @@ extern void error_msg(const char *s, ...)
        va_start(p, s);
        verror_msg(s, p);
        va_end(p);
+       putc('\n', stderr);
 }
 
 extern void error_msg_and_die(const char *s, ...)
@@ -114,6 +115,7 @@ extern void error_msg_and_die(const char *s, ...)
        va_start(p, s);
        verror_msg(s, p);
        va_end(p);
+       putc('\n', stderr);
        exit(EXIT_FAILURE);
 }
 
@@ -361,7 +363,7 @@ copy_file(const char *srcName, const char *destName,
 
        if ((srcStatBuf.st_dev == dstStatBuf.st_dev) &&
                (srcStatBuf.st_ino == dstStatBuf.st_ino)) {
-               error_msg("Copying file \"%s\" to itself\n", srcName);
+               error_msg("Copying file \"%s\" to itself", srcName);
                return FALSE;
        }
 
@@ -921,11 +923,11 @@ long my_getpwnamegid(char *name)
 
        myuser=getpwnam(name);
        if (myuser==NULL)
-               error_msg_and_die( "unknown user name: %s\n", name);
+               error_msg_and_die( "unknown user name: %s", name);
 
        mygroup  = getgrgid(myuser->pw_gid);
        if (mygroup==NULL)
-               error_msg_and_die( "unknown gid %ld\n", (long)myuser->pw_gid);
+               error_msg_and_die( "unknown gid %ld", (long)myuser->pw_gid);
 
        return mygroup->gr_gid;
 }
@@ -1015,7 +1017,7 @@ int get_console_fd(char *tty_name)
                if (is_a_console(fd))
                        return fd;
 
-       error_msg("Couldnt get a file descriptor referring to the console\n");
+       error_msg("Couldnt get a file descriptor referring to the console");
        return -1;                                      /* total failure */
 }
 
@@ -1374,7 +1376,7 @@ extern char * xstrndup (const char *s, int n) {
        char *t;
 
        if (s == NULL)
-               error_msg_and_die("xstrndup bug\n");
+               error_msg_and_die("xstrndup bug");
 
        t = xmalloc(n+1);
        strncpy(t,s,n);
@@ -1495,13 +1497,13 @@ extern int find_real_root_device_name(char* name)
        char fileName[BUFSIZ];
 
        if (stat("/", &rootStat) != 0) {
-               error_msg("could not stat '/'\n");
+               error_msg("could not stat '/'");
                return( FALSE);
        }
 
        dir = opendir("/dev");
        if (!dir) {
-               error_msg("could not open '/dev'\n");
+               error_msg("could not open '/dev'");
                return( FALSE);
        }
 
@@ -1660,7 +1662,7 @@ void xregcomp(regex_t *preg, const char *regex, int cflags)
                int errmsgsz = regerror(ret, preg, NULL, 0);
                char *errmsg = xmalloc(errmsgsz);
                regerror(ret, preg, errmsg, errmsgsz);
-               error_msg_and_die("xregcomp: %s\n", errmsg);
+               error_msg_and_die("xregcomp: %s", errmsg);
        }
 }
 #endif
@@ -1707,7 +1709,7 @@ unsigned long parse_number(const char *numstr, struct suffix_mult *suffixes)
        
        ret = strtoul(numstr, &end, 10);
        if (numstr == end)
-               error_msg_and_die("invalid number `%s'\n", numstr);
+               error_msg_and_die("invalid number `%s'", numstr);
        while (end[0] != '\0') {
                for (sm = suffixes; sm->suffix != NULL; sm++) {
                        len = strlen(sm->suffix);
@@ -1718,7 +1720,7 @@ unsigned long parse_number(const char *numstr, struct suffix_mult *suffixes)
                        }
                }
                if (sm->suffix == NULL)
-                       error_msg_and_die("invalid number `%s'\n", numstr);
+                       error_msg_and_die("invalid number `%s'", numstr);
        }
        return ret;
 }
index fcfcfd903d22197fa7a5a898426c002859c8222a..cccc528729e62d3d0bc7951cc6c6f53b4878917f 100644 (file)
@@ -46,7 +46,7 @@ static int read_stduu (const char *inname)
     char *p;
 
     if (fgets (buf, sizeof(buf), stdin) == NULL) {
-      error_msg("%s: Short file\n", inname);
+      error_msg("%s: Short file", inname);
       return FALSE;
     }
     p = buf;
@@ -81,7 +81,7 @@ static int read_stduu (const char *inname)
 
   if (fgets (buf, sizeof(buf), stdin) == NULL
       || strcmp (buf, "end\n")) {
-    error_msg("%s: No `end' line\n", inname);
+    error_msg("%s: No `end' line", inname);
     return FALSE;
   }
 
@@ -131,7 +131,7 @@ static int read_base64 (const char *inname)
     unsigned char *p;
 
     if (fgets (buf, sizeof(buf), stdin) == NULL) {
-      error_msg("%s: Short file\n", inname);
+      error_msg("%s: Short file", inname);
       return FALSE;
     }
     p = buf;
@@ -139,7 +139,7 @@ static int read_base64 (const char *inname)
     if (memcmp (buf, "====", 4) == 0)
       break;
     if (last_data != 0) {
-      error_msg("%s: data following `=' padding character\n", inname);
+      error_msg("%s: data following `=' padding character", inname);
       return FALSE;
     }
 
@@ -161,14 +161,14 @@ static int read_base64 (const char *inname)
 
       while ((b64_tab[*p] & '\100') != 0)
         if (*p == '\n' || *p++ == '=') {
-          error_msg("%s: illegal line\n", inname);
+          error_msg("%s: illegal line", inname);
           return FALSE;
         }
       c2 = b64_tab[*p++];
 
       while (b64_tab[*p] == '\177')
         if (*p++ == '\n') {
-          error_msg("%s: illegal line\n", inname);
+          error_msg("%s: illegal line", inname);
           return FALSE;
         }
       if (*p == '=') {
@@ -180,7 +180,7 @@ static int read_base64 (const char *inname)
 
       while (b64_tab[*p] == '\177')
         if (*p++ == '\n') {
-          error_msg("%s: illegal line\n", inname);
+          error_msg("%s: illegal line", inname);
           return FALSE;
         }
       putchar (c1 << 2 | c2 >> 4);
@@ -212,7 +212,7 @@ static int decode (const char *inname,
 
   while (1) {
     if (fgets (buf, sizeof (buf), stdin) == NULL) {
-      error_msg("%s: No `begin' line\n", inname);
+      error_msg("%s: No `begin' line", inname);
       return FALSE;
     }
 
@@ -237,13 +237,13 @@ static int decode (const char *inname,
       while (*p != '/')
         ++p;
       if (*p == '\0') {
-        error_msg("%s: Illegal ~user\n", inname);
+        error_msg("%s: Illegal ~user", inname);
         return FALSE;
       }
       *p++ = '\0';
       pw = getpwnam (buf + 1);
       if (pw == NULL) {
-        error_msg("%s: No user `%s'\n", inname, buf + 1);
+        error_msg("%s: No user `%s'", inname, buf + 1);
         return FALSE;
       }
       n = strlen (pw->pw_dir);
index 5df49026b4f658e45d850efa179a3386c6ca769b..73098ba2648db9c703acf0a3c3478a9674e030ef 100644 (file)
@@ -142,7 +142,7 @@ static void encode()
   }
 
   if (ferror (stdin))
-    error_msg("Read error\n");
+    error_msg("Read error");
 
   if (trans_ptr == uu_std) {
     putchar (ENC ('\0'));
@@ -196,7 +196,7 @@ int uuencode_main (int argc,
   encode();
   printf(trans_ptr == uu_std ? "end\n" : "====\n");
   if (ferror (stdout)) {
-    error_msg("Write error\n");
+    error_msg("Write error");
     return EXIT_FAILURE;
   }
   return EXIT_SUCCESS;
diff --git a/wget.c b/wget.c
index 729c6fdc7d501767b78f0b9686b27af83a6867e1..70f8d1b89bb0f021b5ed84a3e4fac5992417362a 100644 (file)
--- a/wget.c
+++ b/wget.c
@@ -148,7 +148,7 @@ int wget_main(int argc, char **argv)
 #endif
        }
        if (do_continue && !fname_out)
-               error_msg_and_die("cannot specify continue (-c) without a filename (-O)\n");
+               error_msg_and_die("cannot specify continue (-c) without a filename (-O)");
 
 
        /*
@@ -200,7 +200,7 @@ int wget_main(int argc, char **argv)
         */
        if (fgets(buf, sizeof(buf), sfp) == NULL) {
                close_and_delete_outfile(output, fname_out, do_continue);
-               error_msg_and_die("no response from server\n");
+               error_msg_and_die("no response from server");
        }
        for (s = buf ; *s != '\0' && !isspace(*s) ; ++s)
                ;
@@ -230,7 +230,7 @@ int wget_main(int argc, char **argv)
                }
                if (strcasecmp(buf, "transfer-encoding") == 0) {
                        close_and_delete_outfile(output, fname_out, do_continue);
-                       error_msg_and_die("server wants to do %s transfer encoding\n", s);
+                       error_msg_and_die("server wants to do %s transfer encoding", s);
                        continue;
                }
        }
@@ -267,7 +267,7 @@ void parse_url(char *url, char **uri_host, int *uri_port, char **uri_path)
        *uri_port = 80;
 
        if (strncmp(url, "http://", 7) != 0)
-               error_msg_and_die("not an http url: %s\n", url);
+               error_msg_and_die("not an http url: %s", url);
 
        *uri_host = url + 7;
 
@@ -297,7 +297,7 @@ FILE *open_socket(char *host, int port)
        memset(&sin, 0, sizeof(sin));
        sin.sin_family = AF_INET;
        if ((hp = (struct hostent *) gethostbyname(host)) == NULL)
-               error_msg_and_die("cannot resolve %s\n", host);
+               error_msg_and_die("cannot resolve %s", host);
        memcpy(&sin.sin_addr, hp->h_addr_list[0], hp->h_length);
        sin.sin_port = htons(port);
 
@@ -338,7 +338,7 @@ char *gethdr(char *buf, size_t bufsiz, FILE *fp, int *istrunc)
 
        /* verify we are at the end of the header name */
        if (*s != ':')
-               error_msg_and_die("bad header line: %s\n", buf);
+               error_msg_and_die("bad header line: %s", buf);
 
        /* locate the start of the header value */
        for (*s++ = '\0' ; *s == ' ' || *s == '\t' ; ++s)
@@ -532,7 +532,7 @@ progressmeter(int flag)
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  *
- *     $Id: wget.c,v 1.24 2001/01/31 17:49:47 andersen Exp $
+ *     $Id: wget.c,v 1.25 2001/01/31 19:00:21 kraai Exp $
  */
 
 
index 870ede43e9f7c9993321a24097e0d69e6deb6797..398e37315a8277a3aa1423dba34c9b05514b24f7 100644 (file)
--- a/whoami.c
+++ b/whoami.c
@@ -38,5 +38,5 @@ extern int whoami_main(int argc, char **argv)
                puts(user);
                return EXIT_SUCCESS;
        }
-       error_msg_and_die("cannot find username for UID %u\n", (unsigned) uid);
+       error_msg_and_die("cannot find username for UID %u", (unsigned) uid);
 }