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