summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorache <ache@FreeBSD.org>1997-12-24 12:31:32 +0000
committerache <ache@FreeBSD.org>1997-12-24 12:31:32 +0000
commit46f0000bfe6e7ca4ae2e0e9c101c86bbc173159f (patch)
treeaebf97050f93202f9787a965b9db9cf2dafb82cf /include
parent12904d6220f8cb08124cec2c90a7f4872c030a2e (diff)
downloadFreeBSD-src-46f0000bfe6e7ca4ae2e0e9c101c86bbc173159f.zip
FreeBSD-src-46f0000bfe6e7ca4ae2e0e9c101c86bbc173159f.tar.gz
snprintf return value fixes to conform Single Unix specs:
1) if buffer size is smaller than arguments size, return buffer size, not arguments size as before. 2) if buffer size is 0, return 0, not EOF as before. (now it is compatible with Linux and Apache implementations too). NOTE: Single Unix specs says: If the value of n {buffer size} is zero on a call to snprintf(), an unspecified value less than 1 is returned. It means we can't return EOF since EOF can take *any* value in general not especially < 1. Better variant will be return -1 (it is less then 1 and different with n == 1 case) but -1 value is already occuped by EOF in our implementation, so we can't distinguish true IO error in that case. So 0 here is only possible case still conforming to Single Unix specs.
Diffstat (limited to 'include')
0 files changed, 0 insertions, 0 deletions
OpenPOWER on IntegriCloud