From cd9a2d252a57c30417f67e92e42ccdcaad3b5f51 Mon Sep 17 00:00:00 2001 From: Laurence Withers Date: Thu, 28 Jan 2010 16:17:53 +0000 Subject: [PATCH] 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. --- src/libiso8601/400_manip.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libiso8601/400_manip.h b/src/libiso8601/400_manip.h index 2f45e2e..57f3a39 100644 --- a/src/libiso8601/400_manip.h +++ b/src/libiso8601/400_manip.h @@ -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 ;