--- libelwix/src/av.c 2014/01/29 14:16:54 1.2 +++ libelwix/src/av.c 2024/10/27 04:24:52 1.4.58.1 @@ -3,7 +3,7 @@ * by Michael Pounov * * $Author: misho $ -* $Id: av.c,v 1.2 2014/01/29 14:16:54 misho Exp $ +* $Id: av.c,v 1.4.58.1 2024/10/27 04:24:52 misho Exp $ * ************************************************************************** The ELWIX and AITNET software is distributed under the following @@ -12,7 +12,7 @@ terms: All of the documentation and software included in the ELWIX and AITNET Releases is copyrighted by ELWIX - Sofia/Bulgaria -Copyright 2004 - 2014 +Copyright 2004 - 2024 by Michael Pounov . All rights reserved. Redistribution and use in source and binary forms, with or without @@ -68,7 +68,7 @@ av_Make(const char * __restrict csArgs, const char *cs return -1; if (psValue && !valLen) return -1; - else + else if (psValue) memset(psValue, 0, valLen); psBuf = e_strdup(csArgs); if (!psBuf) @@ -156,6 +156,9 @@ av_Path2File(const char * __restrict csArgs, char * __ pos = strrchr(psBuf, '/'); if (!pos) { + if (psPath) + strlcpy(psPath, ".", pathLen); + strlcpy(psFile, psBuf, fileLen); e_free(psBuf); @@ -165,7 +168,7 @@ av_Path2File(const char * __restrict csArgs, char * __ strlcpy(psFile, pos, fileLen); if (psPath) - strlcpy(psPath, psBuf, pathLen); + strlcpy(psPath, *psBuf ? psBuf : "/", pathLen); e_free(psBuf); return 2;