* lib/string.in.h: Use _GL_ATTRIBUTE_NONNULL_IF_NONZERO instead of
_GL_ARG_NONNULL in stpncpy. This matches the spirit of N3322.
---
 ChangeLog       | 6 ++++++
 lib/string.in.h | 6 ++++--
 2 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index cc895313b5..bb338f3ddb 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2026-07-31  Lasse Collin  <[email protected]>
+
+       string-h: Use _GL_ATTRIBUTE_NONNULL_IF_NONZERO in stpncpy.
+       * lib/string.in.h: Use _GL_ATTRIBUTE_NONNULL_IF_NONZERO instead of
+       _GL_ARG_NONNULL in stpncpy. This matches the spirit of N3322.
+
 2026-07-31  Lasse Collin  <[email protected]>
 
        string-h: Fix inconsistent nonnull attributes in strncpy.
diff --git a/lib/string.in.h b/lib/string.in.h
index 48637be94f..17ff019765 100644
--- a/lib/string.in.h
+++ b/lib/string.in.h
@@ -645,7 +645,8 @@ _GL_WARN_ON_USE (stpcpy, "stpcpy is unportable - "
 _GL_FUNCDECL_RPL (stpncpy, char *,
                   (char *restrict __dst, char const *restrict __src,
                    size_t __n),
-                  _GL_ARG_NONNULL ((1, 2)));
+                  _GL_ATTRIBUTE_NONNULL_IF_NONZERO (1, 3)
+                  _GL_ATTRIBUTE_NONNULL_IF_NONZERO (2, 3));
 _GL_CXXALIAS_RPL (stpncpy, char *,
                   (char *restrict __dst, char const *restrict __src,
                    size_t __n));
@@ -654,7 +655,8 @@ _GL_CXXALIAS_RPL (stpncpy, char *,
 _GL_FUNCDECL_SYS (stpncpy, char *,
                   (char *restrict __dst, char const *restrict __src,
                    size_t __n),
-                  _GL_ARG_NONNULL ((1, 2)));
+                  _GL_ATTRIBUTE_NONNULL_IF_NONZERO (1, 3)
+                  _GL_ATTRIBUTE_NONNULL_IF_NONZERO (2, 3));
 #  endif
 _GL_CXXALIAS_SYS (stpncpy, char *,
                   (char *restrict __dst, char const *restrict __src,
-- 
2.55.0


Reply via email to