--- libaitsync/src/aitsync.c 2012/11/13 13:19:15 1.3.2.3 +++ libaitsync/src/aitsync.c 2013/05/30 09:24:18 1.5 @@ -3,7 +3,7 @@ * by Michael Pounov * * $Author: misho $ -* $Id: aitsync.c,v 1.3.2.3 2012/11/13 13:19:15 misho Exp $ +* $Id: aitsync.c,v 1.5 2013/05/30 09:24:18 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, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 +Copyright 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013 by Michael Pounov . All rights reserved. Redistribution and use in source and binary forms, with or without @@ -65,29 +65,29 @@ func_comp(sync_tag_t const *t1, sync_tag_t const *t2) */ // sync_GetErrno() Get error code of last operation -inline int +int sync_GetErrno() { return sync_Errno; } // sync_GetError() Get error text of last operation -inline const char * +const char * sync_GetError() { return sync_Error; } // sync_SetErr() Set error to variables for internal use!!! -inline void +void sync_SetErr(int eno, char *estr, ...) { va_list lst; sync_Errno = eno; - memset(sync_Error, 0, STRSIZ); + memset(sync_Error, 0, sizeof sync_Error); va_start(lst, estr); - vsnprintf(sync_Error, STRSIZ, estr, lst); + vsnprintf(sync_Error, sizeof sync_Error, estr, lst); va_end(lst); } @@ -116,7 +116,7 @@ syncSignature(const char *csInput, const char *csSig, if (inf == -1) return inf; if (compress & 2) - f = sync_Temp(szTemp, MAXPATHLEN); + f = sync_Temp(szTemp, sizeof szTemp); else f = sync_Open(csSig, O_WRONLY, 0); if (f == -1) { @@ -195,7 +195,7 @@ syncDelta(const char *csInput, const char *csSig, cons f = sync_Open(csSig, O_RDONLY, 0); if (-1 == f) return f; - sigf = sync_Temp(szTemp, MAXPATHLEN); + sigf = sync_Temp(szTemp, sizeof szTemp); if (-1 == sigf) { sync_Close(f); return sigf; @@ -286,7 +286,7 @@ syncDelta(const char *csInput, const char *csSig, cons return inf; } if (compress & 1) - f = sync_Temp(szTemp, MAXPATHLEN); + f = sync_Temp(szTemp, sizeof szTemp); else f = sync_Open(csDelta, O_WRONLY, 0); if (f == -1) { @@ -456,7 +456,7 @@ syncPatch(const char *csInput, const char *csDelta, co f = sync_Open(csDelta, O_RDONLY, 0); if (f == -1) return f; - d = sync_Temp(szTemp, MAXPATHLEN); + d = sync_Temp(szTemp, sizeof szTemp); if (d == -1) { sync_Close(f); return d;