Use memcpy instead of strncpy in s48_enter_substring.
S48 1.0.1 does this and it's faster .
This commit is contained in:
parent
4540ad4589
commit
ffc4491251
|
@ -1114,7 +1114,7 @@ s48_value
|
||||||
s48_enter_substring(char *str, int length)
|
s48_enter_substring(char *str, int length)
|
||||||
{
|
{
|
||||||
s48_value obj = s48_allocate_stob(S48_STOBTYPE_STRING, length + 1);
|
s48_value obj = s48_allocate_stob(S48_STOBTYPE_STRING, length + 1);
|
||||||
strncpy(S48_UNSAFE_EXTRACT_STRING(obj), str, length);
|
memcpy(S48_UNSAFE_EXTRACT_STRING(obj), str, length);
|
||||||
*(S48_UNSAFE_EXTRACT_STRING(obj) + length) = '\0';
|
*(S48_UNSAFE_EXTRACT_STRING(obj) + length) = '\0';
|
||||||
return obj;
|
return obj;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue