From fc1487cdb0526da63e7c8dbf92b1bcf3e66d356c Mon Sep 17 00:00:00 2001 From: jkh Date: Wed, 21 Aug 1996 01:12:11 +0000 Subject: Add an ftpErrString() function for returning human readable failure codes. Submitted-By: Archie Cobbs --- lib/libftpio/ftpio.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'lib/libftpio/ftpio.c') diff --git a/lib/libftpio/ftpio.c b/lib/libftpio/ftpio.c index c9b18ca..e0555e2 100644 --- a/lib/libftpio/ftpio.c +++ b/lib/libftpio/ftpio.c @@ -14,7 +14,7 @@ * Turned inside out. Now returns xfers as new file ids, not as a special * `state' of FTP_t * - * $Id: ftpio.c,v 1.8 1996/07/04 00:55:20 jkh Exp $ + * $Id: ftpio.c,v 1.9 1996/08/03 11:58:53 jkh Exp $ * */ @@ -165,6 +165,17 @@ ftpErrno(FILE *fp) return ftp->errno; } +const char * +ftpErrString(int errno) +{ + int k; + + for (k = 0; k < ftpErrListLength; k++) + if (ftpErrList[k].num == errno) + return(ftpErrList[k].string); + return("Unknown error"); +} + size_t ftpGetSize(FILE *fp, char *name) { -- cgit v1.1