[imapfilter-devel] Compiler Warnings

Michael Skibbe mskibbe at suse.de
Wed Aug 2 10:53:25 EEST 2006


Hi,

i see that rsnapshot has some little compiler warnings.
i fixed these problems and create a patch. What do you say about this?

--- cert.c
+++ cert.c
@@ -163,11 +163,13 @@
 	FILE *fd;
 	char b, c, buf[64];
 	char *certf;
+	char *rt;
 
 	do {
 		printf("(R)eject, accept (t)emporarily or "
 		    "accept (p)ermanently? ");
-		fgets(buf, sizeof(buf), stdin);
+		rt = fgets(buf, sizeof(buf), stdin);
+		free (rt);
 		c = tolower((int)(*buf));
 	} while (c != 'r' && c != 't' && c != 'p');
 
@@ -210,11 +212,13 @@
 mismatch_cert(void)
 {
 	char c, buf[64];
+	char *rt;
 
 	do {
 		printf("ATTENTION: SSL/TLS certificate fingerprint mismatch.\n"
 		    "Proceed with the connection (y/n)? ");
-		fgets(buf, sizeof(buf), stdin);
+		rt = fgets(buf, sizeof(buf), stdin);
+		free(rt);
 		c = tolower((int)(*buf));
 	} while (c != 'y' && c != 'n');
 
--- system.c
+++ system.c
@@ -211,8 +211,10 @@
 	luaL_checktype(lua, 1, LUA_TUSERDATA);
 	luaL_checktype(lua, 2, LUA_TSTRING);
 
-	fwrite(lua_tostring(lua, 2), sizeof(char), strlen(lua_tostring(lua,
+	size_t rt;
+	rt = fwrite(lua_tostring(lua, 2), sizeof(char), strlen(lua_tostring(lua,
 	    2)), *(FILE **) (lua_touserdata(lua, 1)));
+	free(&rt);
 
 	lua_pop(lua, 2);
 
@@ -283,8 +285,10 @@
 	close(STDOUT_FILENO);
 	close(STDERR_FILENO);
 	if (open("/dev/null", O_RDWR) != -1) {
-		dup(STDIN_FILENO);
-		dup(STDIN_FILENO);
+		int rt = 0;
+		rt = dup(STDIN_FILENO);
+		rt = dup(STDIN_FILENO);
+		free(&rt);
 	}
 
 	return 0;

Greetings from Nuremberg
Michael
-- 
----------------------------
| Michael Skibbe           |
| Core Services            |
| SUSE Linux Products GmbH |
----------------------------




More information about the Imapfilter-devel mailing list