lib/iec_std_lib.h
changeset 313 90c3772e6547
parent 291 1b0686c546ab
child 314 41d4ac0b4821
equal deleted inserted replaced
312:29add821207d 313:90c3772e6547
   383     STRING res;
   383     STRING res;
   384     __strlen_t to_copy;
   384     __strlen_t to_copy;
   385     TEST_EN_COND(STRING, P < 0)
   385     TEST_EN_COND(STRING, P < 0)
   386     res = __INIT_STRING;
   386     res = __INIT_STRING;
   387 
   387 
   388     to_copy = P > IN1.len ? IN1.len : P - 1;
   388     to_copy = P > IN1.len ? IN1.len : P;
   389     memcpy(&res.body, &IN1.body , to_copy);
   389     memcpy(&res.body, &IN1.body , to_copy);
   390     P = res.len = to_copy;
   390     P = res.len = to_copy;
   391 
   391 
   392     to_copy = IN2.len + res.len > STR_MAX_LEN ? STR_MAX_LEN - res.len : IN2.len;
   392     to_copy = IN2.len + res.len > STR_MAX_LEN ? STR_MAX_LEN - res.len : IN2.len;
   393     memcpy(&res.body[res.len], &IN2.body , to_copy);
   393     memcpy(&res.body[res.len], &IN2.body , to_copy);