[Pkg-shadow-commits] r2803 - in upstream/trunk: . lib

Nicolas FRANÇOIS nekral-guest at alioth.debian.org
Sat Apr 25 12:43:27 UTC 2009


Author: nekral-guest
Date: 2009-04-25 12:43:27 +0000 (Sat, 25 Apr 2009)
New Revision: 2803

Modified:
   upstream/trunk/ChangeLog
   upstream/trunk/lib/commonio.c
   upstream/trunk/lib/commonio.h
Log:
	* lib/commonio.h, lib/commonio.c: Added splint annotations.


Modified: upstream/trunk/ChangeLog
===================================================================
--- upstream/trunk/ChangeLog	2009-04-25 11:06:35 UTC (rev 2802)
+++ upstream/trunk/ChangeLog	2009-04-25 12:43:27 UTC (rev 2803)
@@ -1,5 +1,9 @@
 2009-04-25  Nicolas François  <nicolas.francois at centraliens.net>
 
+	* lib/commonio.h, lib/commonio.c: Added splint annotations.
+
+2009-04-25  Nicolas François  <nicolas.francois at centraliens.net>
+
 	* NEWS, po/pt.po: Updated Portuguese translation.
 
 2009-04-25  Nicolas François  <nicolas.francois at centraliens.net>

Modified: upstream/trunk/lib/commonio.c
===================================================================
--- upstream/trunk/lib/commonio.c	2009-04-25 11:06:35 UTC (rev 2802)
+++ upstream/trunk/lib/commonio.c	2009-04-25 12:43:27 UTC (rev 2803)
@@ -46,7 +46,7 @@
 #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"
@@ -55,7 +55,10 @@
 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 *);
@@ -178,8 +181,10 @@
 }
 
 
-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;
@@ -488,9 +493,9 @@
 	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;
@@ -542,10 +547,10 @@
 		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);
@@ -554,7 +559,9 @@
 			}
 			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;
 			}
 		}

Modified: upstream/trunk/lib/commonio.h
===================================================================
--- upstream/trunk/lib/commonio.h	2009-04-25 11:06:35 UTC (rev 2802)
+++ upstream/trunk/lib/commonio.h	2009-04-25 12:43:27 UTC (rev 2803)
@@ -117,7 +117,7 @@
 	/*
 	 * Currently open file stream.
 	 */
-	/*@null@*/FILE *fp;
+	/*@dependent@*/ /*@null@*/FILE *fp;
 
 #ifdef WITH_SELINUX
 	/*@null@*/security_context_t scontext;




More information about the Pkg-shadow-commits mailing list