X-Git-Url: https://pd.if.org/git/?p=pdclib.old;a=blobdiff_plain;f=functions%2Fstdio%2Fperror.c;h=609562a8e46a783a89420808117163d6d8ce5c5e;hp=c59ca0b290a582934f50c3b4a467002915a4a527;hb=a79f08f3acbea9b76410462f139a2aa9e6e1311d;hpb=c32195e1cf378ef639cc6334b7f9d28eb2b421a4 diff --git a/functions/stdio/perror.c b/functions/stdio/perror.c index c59ca0b..609562a 100644 --- a/functions/stdio/perror.c +++ b/functions/stdio/perror.c @@ -10,9 +10,16 @@ #ifndef REGTEST +#include + +/* TODO: Doing this via a static array is not the way to do it. */ void perror( const char * s ) { - /* TODO: Implement. */ + if ( ( s != NULL ) && ( s[0] != '\n' ) ) + { + fprintf( stderr, "%s: ", s ); + } + fprintf( stderr, "%s\n", _PDCLIB_errno_texts[ errno ] ); return; }