]> The Tcpdump Group git mirrors - tcpdump/commitdiff
Remove "\n" in error() calls: It is added in the function
authorFrancois-Xavier Le Bail <[email protected]>
Mon, 7 Apr 2025 12:04:46 +0000 (14:04 +0200)
committerFrancois-Xavier Le Bail <[email protected]>
Mon, 7 Apr 2025 14:02:57 +0000 (16:02 +0200)
(cherry picked from commit c602726f3a91f2c344bde10c6e2f3c6149a15adc)

tcpdump.c

index 9edeea74f387a8c383dd3c2b707e738530e3c640..70d6f75c336faf7e28d6f830d736f4cb8c56856f 100644 (file)
--- a/tcpdump.c
+++ b/tcpdump.c
@@ -791,7 +791,7 @@ droproot(const char *username, const char *chroot_dir)
                {
                        int ret = capng_change_id(pw->pw_uid, pw->pw_gid, CAPNG_NO_FLAG);
                        if (ret < 0)
-                               error("capng_change_id(): return %d\n", ret);
+                               error("capng_change_id(): return %d", ret);
                        else
                                fprintf(stderr, "dropped privs to %s\n", username);
                }
@@ -1425,7 +1425,7 @@ open_interface(const char *device, netdissect_options *ndo, char *ebuf)
                         * specific case would be an error message that looks a bit odd.
                         */
                        newdev[strlen(newdev)-1]++;
-                       error("%s is not a monitor mode VAP\n"
+                       error("%s is not a monitor mode VAP"
                            "To create a new monitor mode VAP use:\n"
                            "  ifconfig %s create wlandev %s wlanmode monitor\n"
                            "and use %s as the tcpdump interface",
@@ -2127,7 +2127,7 @@ main(int argc, char **argv)
 #if defined(HAVE_FORK) || defined(HAVE_VFORK)
                        zflag = optarg;
 #else
-                       error("-z cannot be used. Fork subprocess not implemented.\n");
+                       error("-z cannot be used. Fork subprocess not implemented.");
 #endif
                        break;
 
@@ -2204,12 +2204,12 @@ main(int argc, char **argv)
        if (ndo->ndo_xflag && ndo->ndo_Xflag)
                error("-x[x] and -X[X] are mutually exclusive.");
        if (Cflag != 0 && WFileName == NULL)
-               error("-C cannot be used without -w.\n");
+               error("-C cannot be used without -w.");
        if (Gflag != 0 && WFileName == NULL)
-               error("-G cannot be used without -w.\n");
+               error("-G cannot be used without -w.");
 #if defined(HAVE_FORK) || defined(HAVE_VFORK)
        if (zflag != NULL && (WFileName == NULL || (Cflag == 0 && Gflag == 0)))
-               error("-z cannot be used without -w and (-C or -G).\n");
+               error("-z cannot be used without -w and (-C or -G).");
 #endif
 
 #ifdef HAVE_PCAP_FINDALLDEVS
@@ -2305,11 +2305,11 @@ main(int argc, char **argv)
                                VFile = fopen(VFileName, "r");
 
                        if (VFile == NULL)
-                               error("Unable to open file: %s\n", pcap_strerror(errno));
+                               error("Unable to open file: %s", pcap_strerror(errno));
 
                        ret = get_next_file(VFile, VFileLine);
                        if (!ret)
-                               error("Nothing in %s\n", VFileName);
+                               error("Nothing in %s", VFileName);
                        RFileName = VFileLine;
                }