1
0
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:
Jonas Fonseca 2005-12-28 23:06:23 +01:00 committed by Jonas Fonseca
parent 4feba6d515
commit 3d0fc33785

View File

@ -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;
}
}