Skip to content

Commit

Permalink
Merge branch 'OpenEtherCATsociety:master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
limymy authored Dec 6, 2024
2 parents 667283a + 83c6264 commit 5a888fb
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
8 changes: 8 additions & 0 deletions soem/ethercatfoe.c
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,10 @@ int ecx_FOEread(ecx_contextt *context, uint16 slave, char *filename, uint32 pass
aFOEp = (ec_FOEt *)&MbxIn;
FOEp = (ec_FOEt *)&MbxOut;
fnsize = (uint16)strlen(filename);
if (fnsize > EC_MAXFOEDATA)
{
fnsize = EC_MAXFOEDATA;
}
maxdata = context->slavelist[slave].mbx_l - 12;
if (fnsize > maxdata)
{
Expand Down Expand Up @@ -216,6 +220,10 @@ int ecx_FOEwrite(ecx_contextt *context, uint16 slave, char *filename, uint32 pas
FOEp = (ec_FOEt *)&MbxOut;
dofinalzero = TRUE;
fnsize = (uint16)strlen(filename);
if (fnsize > EC_MAXFOEDATA)
{
fnsize = EC_MAXFOEDATA;
}
maxdata = context->slavelist[slave].mbx_l - 12;
if (fnsize > maxdata)
{
Expand Down
2 changes: 1 addition & 1 deletion test/linux/ebox/ebox.c
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ void add_timespec(struct timespec *ts, int64 addtime)
sec = (addtime - nsec) / NSEC_PER_SEC;
ts->tv_sec += sec;
ts->tv_nsec += nsec;
if ( ts->tv_nsec > NSEC_PER_SEC )
if ( ts->tv_nsec >= NSEC_PER_SEC )
{
nsec = ts->tv_nsec % NSEC_PER_SEC;
ts->tv_sec += (ts->tv_nsec - nsec) / NSEC_PER_SEC;
Expand Down
2 changes: 1 addition & 1 deletion test/win32/ebox/ebox.c
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ void add_timespec(struct timespec *ts, int64 addtime)
sec = (addtime - nsec) / NSEC_PER_SEC;
ts->tv_sec += sec;
ts->tv_nsec += nsec;
if ( ts->tv_nsec > NSEC_PER_SEC )
if ( ts->tv_nsec >= NSEC_PER_SEC )
{
nsec = ts->tv_nsec % NSEC_PER_SEC;
ts->tv_sec += (ts->tv_nsec - nsec) / NSEC_PER_SEC;
Expand Down

0 comments on commit 5a888fb

Please sign in to comment.