X-Git-Url: https://pd.if.org/git/?p=pdclib;a=blobdiff_plain;f=functions%2Fstdio%2Fperror.c;h=609562a8e46a783a89420808117163d6d8ce5c5e;hp=c59ca0b290a582934f50c3b4a467002915a4a527;hb=4116251e9bb6c386580d71d8c4afd2d0d08c6096;hpb=1353fd26a568d3145525a26e516b13089f249545 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; }