Hello, since most of the files in sysfs are text files, it would be nice, if the "store" function called during sysfs_write_file() gets a zero terminated string / data. The current implementation seems not to ensure this. (But only if it is the first time the zeroed buffer page is allocated.) So the buffer can be scanned by sscanf() easily, for example. This patch simply sets a \0 char behind the data in buffer->page. Signed-off-by: Thomas Maier <[email protected]>
Attachment:
sysfs_write_file-zero-term-string.patch
Description: Binary data
- Follow-Ups:
- Prev by Date: Re: [PATCH 0/7] KVM: Kernel-based Virtual Machine
- Next by Date: [PATCH] 2.6.19-rc2-mm2 pktcdvd: add sysfs and debugfs interface
- Previous by thread: CONFIG_MODVERSION
- Next by thread: Re: [PATCH] 2.6.19-rc2-mm2 sysfs: sysfs_write_file() writes zero terminated data
- Index(es):