[parted-devel] avoid printf, when easy to do
Debarshi 'Rishi' Ray
debarshi.ray at gmail.com
Wed Mar 7 20:59:47 CET 2007
> I'm ambivalent about using "puts" (which you've done correctly)
> because of it's somewhat "hidden" semantics of adding a trailing newline.
> Sometimes it's more maintainer/translator-friendly to use fputs and
> include an explicit "\n" at the end of the literal string, in spite of
> the need for the added stdout or stderr argument.
Some of the messages being sent to 'stdout' seem to be error messages,
and should have been sent to 'stderr' instead. eg., the following
snippet in libparted/labels/vtoc.c
if (tmp == NULL) {
/* BUG: no free extent found */
- printf("BUG: no free FMT5 DSCB extent found!\nexiting...\n");
+ puts ("BUG: no free FMT5 DSCB extent found!\nexiting...");
exit(1);
}
We can change them if necessary to fputs(..., stderr) in a later
delta. Comments?
> > #include <config.h>
> > -
> > +v
> Typo?
Yes. Happened during C-v in Emacs. Fixed it.
Happy hacking,
Debarshi
--
GPG key ID: 63D4A5A7
Key server: pgp.mit.edu
More information about the parted-devel
mailing list