sysfs.txt: update show method notes about sprintf/snprintf/scnprintf usage
[sfrench/cifs-2.6.git] / Documentation / filesystems / sysfs.txt
index b35a64b82f9e8371d42fcf893354d02c07c6c229..9494afb9476a4b667224fe220fa4ca5ee16ac9ba 100644 (file)
@@ -212,7 +212,10 @@ Other notes:
 - show() methods should return the number of bytes printed into the
   buffer. This is the return value of scnprintf().
 
-- show() should always use scnprintf().
+- show() must not use snprintf() when formatting the value to be
+  returned to user space. If you can guarantee that an overflow
+  will never happen you can use sprintf() otherwise you must use
+  scnprintf().
 
 - store() should return the number of bytes used from the buffer. If the
   entire buffer has been used, just return the count argument.