From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: <20010510051144.209.qmail@g.bio.cse.psu.edu> From: "Scott Schwartz" To: 9fans@cse.psu.edu Subject: [9fans] snprint(), getfields() specification Date: Thu, 10 May 2001 01:11:44 -0400 Topicbox-Message-UUID: 9c8c1a54-eac9-11e9-9e20-41e7f4b1d025 The getfields() manpage says, If there are more than maxargs fields, only the first maxargs fields will be set. ... Getfields return the number of tokens processed. snprint() says something similar. In both cases, if the limit is too small, there's no way to find out how much space you actually needed. Unix snprintf returns that value; compare with the limit to know if you need to allocate more space, or emit an error, or just use what you got. I think we might be better off adopting that convention.