X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=elogind.git;a=blobdiff_plain;f=libsysfs%2Fsysfs_dir.c;h=8ce852220024bd5711f05a54cf3ee6cb0a15cf2e;hp=be54a1cf8689fe884dda70c59c45ab3db416dd0b;hb=656703759d7d3eac6e8c86f1121cde7dfd6d8cbd;hpb=d1fb871d99db38c7704d8e583ff5e0a00e713837 diff --git a/libsysfs/sysfs_dir.c b/libsysfs/sysfs_dir.c index be54a1cf8..8ce852220 100644 --- a/libsysfs/sysfs_dir.c +++ b/libsysfs/sysfs_dir.c @@ -239,10 +239,10 @@ int sysfs_write_attribute(struct sysfs_attribute *sysattr, sysattr->value = (char *)realloc (sysattr->value, length); sysattr->len = length; - safestrncpy(sysattr->value, new_value, length); + safestrcpymax(sysattr->value, new_value, length); } else { /*"length" of the new value is same as old one */ - safestrncpy(sysattr->value, new_value, length); + safestrcpymax(sysattr->value, new_value, length); } } @@ -348,7 +348,7 @@ int sysfs_read_attribute_value(const char *attrpath, if (length > vsize) dprintf("Value length %d is larger than supplied buffer %d\n", length, vsize); - safestrncpy(value, attr->value, vsize); + safestrcpymax(value, attr->value, vsize); sysfs_close_attribute(attr); return 0;