mirror of
https://github.com/rkd77/elinks.git
synced 2025-02-02 15:09:23 -05:00
set_mem_comment(): Use memcpy() + NUL assignment instead of safe_strncpy()
... so as not to depend on util/string stuff.
This commit is contained in:
parent
4feba6d515
commit
3d0fc33785
@ -551,7 +551,8 @@ set_mem_comment(void *ptr, unsigned char *str, int len)
|
||||
|
||||
ah->comment = malloc(len + 1);
|
||||
if (ah->comment) {
|
||||
safe_strncpy(ah->comment, str, len + 1);
|
||||
memcpy(ah->comment, str, len);
|
||||
ah->comment[len] = 0;
|
||||
mem_stats.true_amount += len + 1;
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user