chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
[PATCH] more Libsysfs updates
[elogind.git]
/
libsysfs
/
sysfs_dir.c
diff --git
a/libsysfs/sysfs_dir.c
b/libsysfs/sysfs_dir.c
index be54a1cf8689fe884dda70c59c45ab3db416dd0b..8ce852220024bd5711f05a54cf3ee6cb0a15cf2e 100644
(file)
--- 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;
sysattr->value = (char *)realloc
(sysattr->value, length);
sysattr->len = length;
- safestr
ncpy
(sysattr->value, new_value, length);
+ safestr
cpymax
(sysattr->value, new_value, length);
} else {
/*"length" of the new value is same as old one */
} else {
/*"length" of the new value is same as old one */
- safestr
ncpy
(sysattr->value, new_value, length);
+ safestr
cpymax
(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);
if (length > vsize)
dprintf("Value length %d is larger than supplied buffer %d\n",
length, vsize);
- safestr
ncpy
(value, attr->value, vsize);
+ safestr
cpymax
(value, attr->value, vsize);
sysfs_close_attribute(attr);
return 0;
sysfs_close_attribute(attr);
return 0;