diff --git a/utils/SerPortServer.c b/utils/SerPortServer.c index 748a86b..3495163 100755 --- a/utils/SerPortServer.c +++ b/utils/SerPortServer.c @@ -1158,7 +1158,9 @@ static int RS__MAX_ASYNCH = 20; /* Asynch "ports" 0 - 19 will be allowed */ Cl_info[i].remaining -= bytes_got; Cl_info[i].nxt_rply_ptr1 += bytes_got; - memcpy (Ts_info[indx].tp_ahd, &rcve[bytes_got], (j - bytes_got)); + if( (j - bytes_got) > 0){ + memcpy (Ts_info[indx].tp_ahd, &rcve[bytes_got], (j - bytes_got)); + } Ts_info[indx].tp_nxt = j - bytes_got; } if (term_fnd) { /* Response complete? */