NetBSD Problem Report #13650

Received: (qmail 834 invoked from network); 7 Aug 2001 21:59:00 -0000
Message-Id: <200108072203.f77M32Y00828@bandsept.script.jussieu.fr>
Date: Wed, 8 Aug 2001 00:03:02 +0200 (CEST)
From: Stoned Elipot <Stoned.Elipot@script.jussieu.fr>
Reply-To: Stoned.Elipot@script.jussieu.fr
To: gnats-bugs@gnats.netbsd.org
Cc: seb@pbox.org
Subject: pkgsrc/pkgtools/digest/files/digest.c:main() miss trailing newline in error messages
X-Send-Pr-Version: 3.95

>Number:         13650
>Category:       pkg
>Synopsis:       digest.c:main() miss trailing newline in error messages
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    pkg-manager
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Tue Aug 07 22:00:00 +0000 2001
>Closed-Date:    Tue Aug 07 22:11:26 +0000 2001
>Last-Modified:  Tue Aug 07 22:11:26 +0000 2001
>Originator:     Stoned Elipot
>Release:        NetBSD 1.5.1
>Organization:
SCRIPT, Paris VII University, France
>Environment:
System: NetBSD bandsept 1.5.1 NetBSD 1.5.1 (GENERIC) #0: Mon Jul 9 22:42:32 CST 2001 toor@proxima:/usr/src/sys/arch/sparc/compile/GENERIC sparc


>Description:
when digest.c:main() encounter an error the message emitted on stderr miss a
trailing newline.
>How-To-Repeat:
$ digest foo
$ digest md5 /non-existant
...
>Fix:
The following trivial patch could do the job I guess.

Index: files/digest.c
===================================================================
RCS file: /cvsroot/pkgsrc/pkgtools/digest/files/digest.c,v
retrieving revision 1.3
diff -u -r1.3 digest.c
--- digest.c	2001/07/09 21:42:30	1.3
+++ digest.c	2001/08/07 22:01:23
@@ -242,19 +242,19 @@
 		return EXIT_FAILURE;
 	}
 	if ((alg = find_algorithm(argv[optind])) == NULL) {
-		(void) fprintf(stderr, "No such algorithm `%s'", argv[optind]);
+		(void) fprintf(stderr, "No such algorithm `%s'\n", argv[optind]);
 		exit(EXIT_FAILURE);
 	}
 	rval = EXIT_SUCCESS;
 	if (argc == optind + 1) {
 		if (!(*alg->func)(NULL)) {
-			(void) fprintf(stderr, "stdin");
+			(void) fprintf(stderr, "stdin\n");
 			rval = EXIT_FAILURE;
 		}
 	} else {
 		for (i = optind + 1 ; i < argc ; i++) {
 			if (!(*alg->func)(argv[i])) {
-				(void) fprintf(stderr, "%s", argv[i]);
+				(void) fprintf(stderr, "%s\n", argv[i]);
 				rval = EXIT_FAILURE;
 			}
 		}
>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->closed 
State-Changed-By: wiz 
State-Changed-When: Tue Aug 7 15:10:16 PDT 2001 
State-Changed-Why:  
Applied -- thanks! 
>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.51 2026/08/10 02:28:17 riastradh Exp $
$NetBSD: gnats_config.sh,v 1.10 2026/05/13 22:00:09 riastradh Exp $
Copyright © 1994-2026 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.