+2009-04-22 Nicolas François <nicolas.francois@centraliens.net>
+
+ * lib/gshadow.c, lib/commonio.h: Added splint annotations.
+
2009-04-22 Nicolas François <nicolas.francois@centraliens.net>
* lib/get_gid.c: gidstr should not be NULL, but the check was
* Make a copy of the object (for example, struct passwd)
* and all strings pointed by it, in malloced memory.
*/
- void *(*dup) (const void *);
+ /*@null@*/ /*@only@*/void *(*dup) (const void *);
/*
* free() the object including any strings pointed by it.
* fgets and fputs (can be replaced by versions that
* understand line continuation conventions).
*/
- char *(*fgets) (char *, int, FILE *);
+ /*@null@*/char *(*fgets) (/*@returned@*/ /*@out@*/char *s, int n, FILE *stream);
int (*fputs) (const char *, FILE *);
/*
#include <stdio.h>
#include "prototypes.h"
#include "defines.h"
-static FILE *shadow;
+static /*@null@*/FILE *shadow;
static char sgrbuf[BUFSIZ * 4];
-static char **members = NULL;
+static /*@null@*//*@only@*/char **members = NULL;
static size_t nmembers = 0;
-static char **admins = NULL;
+static /*@null@*//*@only@*/char **admins = NULL;
static size_t nadmins = 0;
static struct sgrp sgroup;
}
#endif
-static char **build_list (char *s, char **list[], size_t * nlist)
+static /*@null@*/char **build_list (char *s, char **list[], size_t * nlist)
{
char **ptr = *list;
size_t nelem = *nlist, size;
shadow = (FILE *) 0;
}
-struct sgrp *sgetsgent (const char *string)
+/*@observer@*//*@null@*/struct sgrp *sgetsgent (const char *string)
{
char *fields[FIELDS];
char *cp;
* converts it to a (struct sgrp). NULL is returned on EOF.
*/
-struct sgrp *fgetsgent (FILE * fp)
+/*@observer@*//*@null@*/struct sgrp *fgetsgent (/*@null@*/FILE * fp)
{
char buf[sizeof sgrbuf];
char *cp;
* getsgent - get a single shadow group entry
*/
-struct sgrp *getsgent (void)
+/*@observer@*//*@null@*/struct sgrp *getsgent (void)
{
#ifdef USE_NIS
bool nis_1_group = false;
* getsgnam - get a shadow group entry by name
*/
-struct sgrp *getsgnam (const char *name)
+/*@observer@*//*@null@*/struct sgrp *getsgnam (const char *name)
{
struct sgrp *sgrp;
strcpy (cp, sgrp->sg_adm[i]);
cp += strlen (cp);
}
- *cp++ = ':';
+ *cp = ':';
+ cp++;
/*
* Now do likewise with the group members.