iso8601_difference(): incorrect nonnull attribute

iso8601_difference was incorrectly marked as having all of its attributes
required to be non-null, but this is not the case according to the docs or
the implementation. This was causing a crash as the compiled library was
taking advantage of the nonnull notation to remove some tests against null
which, according to the docs, are actually required.

Fix by tightening the nonnull specification to those parameters which actually
require it.
This commit is contained in:
Laurence Withers 2010-01-28 16:17:53 +00:00
parent ed05b5c872
commit cd9a2d252a
1 changed files with 1 additions and 1 deletions

View File

@ -148,7 +148,7 @@ stored in \a sign (if it is not a null pointer), i.e. -1 if \a d2 > \a d1 or
void iso8601_difference(const struct iso8601_date* d1,
const struct iso8601_date* d2, struct iso8601_elapsed* per, int* sign)
#ifndef DOXYGEN
__attribute__((nonnull))
__attribute__((nonnull(1,2)))
#endif
;