]> git.ipfire.org Git - thirdparty/shadow.git/commitdiff
lib/: get[u]long(): Use ATTR_ACCESS() instead of /*@out@*/
authorAlejandro Colomar <alx@kernel.org>
Mon, 11 Dec 2023 13:16:31 +0000 (14:16 +0100)
committerSerge Hallyn <serge@hallyn.com>
Mon, 15 Jan 2024 19:14:28 +0000 (13:14 -0600)
Link: <https://splint.org/manual/manual.html#undefined>
Cc: Serge Hallyn <serge@hallyn.com>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
lib/getlong.c
lib/getulong.c
lib/prototypes.h

index 1f85f2885a400b0494e7face305cc04d52fd4921..4c6e376c5925cd08e41ca97cdccb3d658310232b 100644 (file)
@@ -21,7 +21,7 @@
  * It supports decimal, hexadecimal or octal representations.
  */
 int
-getlong(const char *numstr, /*@out@*/long *result)
+getlong(const char *numstr, long *result)
 {
        char  *endptr;
        long  val;
index 613c657b49cf2438bf2973603484729a7946d586..690525551dfc7d74d648628e274f43f92dbc53a8 100644 (file)
@@ -21,7 +21,7 @@
  * It supports decimal, hexadecimal or octal representations.
  */
 int
-getulong(const char *numstr, /*@out@*/unsigned long *result)
+getulong(const char *numstr, unsigned long *result)
 {
        char           *endptr;
        unsigned long  val;
index 804ad96fe97024a1cae99afaa1e0a4e174f1676c..4ba943645cd480cc832aa54cf6193ae5df7ff80c 100644 (file)
@@ -153,7 +153,8 @@ extern int get_gid (const char *gidstr, gid_t *gid);
 extern /*@only@*//*@null@*/struct group *getgr_nam_gid (/*@null@*/const char *grname);
 
 /* getlong.c */
-extern int getlong (const char *numstr, /*@out@*/long *result);
+ATTR_ACCESS(write_only, 2)
+extern int getlong(const char *numstr, long *result);
 
 /* get_pid.c */
 extern int get_pid (const char *pidstr, pid_t *pid);
@@ -172,7 +173,8 @@ extern time_t gettime (void);
 extern int get_uid (const char *uidstr, uid_t *uid);
 
 /* getulong.c */
-extern int getulong (const char *numstr, /*@out@*/unsigned long *result);
+ATTR_ACCESS(write_only, 2)
+extern int getulong(const char *numstr, unsigned long *result);
 
 /* fputsx.c */
 ATTR_ACCESS(write_only, 1, 2)