+2009-04-25 Nicolas François <nicolas.francois@centraliens.net>
+
+ * lib/commonio.h, lib/commonio.c: Added splint annotations.
+
2009-04-25 Nicolas François <nicolas.francois@centraliens.net>
* NEWS, po/pt.po: Updated Portuguese translation.
#include "nscd.h"
#ifdef WITH_SELINUX
#include <selinux/selinux.h>
-static security_context_t old_context = NULL;
+static /*@null@*/security_context_t old_context = NULL;
#endif
#include "prototypes.h"
#include "commonio.h"
static int lrename (const char *, const char *);
static int check_link_count (const char *file);
static int do_lock_file (const char *file, const char *lock);
-static FILE *fopen_set_perms (const char *, const char *, const struct stat *);
+static /*@null@*/ /*@dependent@*/FILE *fopen_set_perms (
+ const char *name,
+ const char *mode,
+ const struct stat *sb);
static int create_backup (const char *, FILE *);
static void free_linked_list (struct commonio_db *);
static void add_one_entry (struct commonio_db *, struct commonio_entry *);
}
-static FILE *fopen_set_perms (const char *name, const char *mode,
- const struct stat *sb)
+static /*@null@*/ /*@dependent@*/FILE *fopen_set_perms (
+ const char *name,
+ const char *mode,
+ const struct stat *sb)
{
FILE *fp;
mode_t mask;
char *cp;
char *line;
struct commonio_entry *p;
- void *eptr;
+ void *eptr = NULL;
int flags = mode;
- int buflen;
+ size_t buflen;
int saved_errno;
mode &= ~O_CREAT;
goto cleanup_ENOMEM;
}
- while (db->ops->fgets (buf, buflen, db->fp) == buf) {
+ while (db->ops->fgets (buf, (int) buflen, db->fp) == buf) {
while ( ((cp = strrchr (buf, '\n')) == NULL)
&& (feof (db->fp) == 0)) {
- int len;
+ size_t len;
buflen += BUFLEN;
cp = (char *) realloc (buf, buflen);
}
buf = cp;
len = strlen (buf);
- if (db->ops->fgets (buf + len, buflen - len, db->fp) == NULL) {
+ if (db->ops->fgets (buf + len,
+ (int) (buflen - len),
+ db->fp) == NULL) {
goto cleanup_buf;
}
}