COMP: Fix C build problem in certain conditions

This commit is contained in:
Andy Cedilnik 2004-10-06 08:02:18 -04:00
parent f47690ecaa
commit 84f04477b2
1 changed files with 8 additions and 6 deletions

View File

@ -547,12 +547,14 @@ const char *Curl_strerror(struct connectdata *conn, int err)
} }
#endif /* end of HAVE_GLIBC_STRERROR_R */ #endif /* end of HAVE_GLIBC_STRERROR_R */
#else /* HAVE_STRERROR_R */ #else /* HAVE_STRERROR_R */
char *msg = strerror(err); {
if ( !msg ) char *msg = strerror(err);
{ if ( !msg )
msg = "Unknown System Error"; {
} msg = "Unknown System Error";
strncpy(buf, msg, max); }
strncpy(buf, msg, max);
}
#endif /* end of HAVE_STRERROR_R */ #endif /* end of HAVE_STRERROR_R */
#endif /* end of ! Windows */ #endif /* end of ! Windows */