setup: Makefile, delpasswd.c, joinpasswd.c, update-fstab.c size_t for size ...

arekm arekm at pld-linux.org
Fri May 31 20:37:09 CEST 2013


Author: arekm                        Date: Fri May 31 18:37:09 2013 GMT
Module: setup                         Tag: HEAD
---- Log message:
size_t for size variables.

---- Files affected:
setup:
   Makefile (1.36 -> 1.37) , delpasswd.c (1.4 -> 1.5) , joinpasswd.c (1.14 -> 1.15) , update-fstab.c (1.5 -> 1.6) 

---- Diffs:

================================================================
Index: setup/Makefile
diff -u setup/Makefile:1.36 setup/Makefile:1.37
--- setup/Makefile:1.36	Sun Jan 29 12:25:22 2012
+++ setup/Makefile	Fri May 31 20:37:04 2013
@@ -4,7 +4,7 @@
 VERSION		= 2.8.4
 
 CC		= gcc
-OPT_FLAGS	= -O2 -g
+OPT_FLAGS	= -fwrapv -pipe -Wformat -Werror=format-security -gdwarf-4 -fno-debug-types-section -fvar-tracking-assignments -g2 -Wp,-D_FORTIFY_SOURCE=2 -fstack-protector --param=ssp-buffer-size=4 -fPIC -march=x86-64 -gdwarf-4 -fno-debug-types-section -fvar-tracking-assignments -g2  -Os -Wall
 CFLAGS		= $(OPT_FLAGS) -Wall
 INSTALL		= install
 SBINDIR		= /sbin

================================================================
Index: setup/delpasswd.c
diff -u setup/delpasswd.c:1.4 setup/delpasswd.c:1.5
--- setup/delpasswd.c:1.4	Fri May 31 20:33:53 2013
+++ setup/delpasswd.c	Fri May 31 20:37:04 2013
@@ -92,7 +92,7 @@
 	exit(1);
 }
 
-char *map_file(const char *name, int *sz)
+char *map_file(const char *name, size_t *sz)
 {
 	int fd;
 	void *ptr;
@@ -252,8 +252,7 @@
 int verifyp(const char *old_name, int namesc, const char **names)
 {
 	char *old, *id;
-	int i;
-	int old_sz;
+	size_t i, old_sz;
 
 	// Fail silently if file does not exist
 	if (access(old_name, F_OK) == -1)
@@ -288,8 +287,8 @@
 		int namesc, const char **names)
 {
 	char *old, *tmp, *id;
-	int i, fd;
-	int old_sz;
+	int fd;
+	size_t i, old_sz;
 
 	// Fail silently if file does not exist
 	if (access(old_name, F_OK) == -1)

================================================================
Index: setup/joinpasswd.c
diff -u setup/joinpasswd.c:1.14 setup/joinpasswd.c:1.15
--- setup/joinpasswd.c:1.14	Thu Dec  8 20:25:04 2011
+++ setup/joinpasswd.c	Fri May 31 20:37:04 2013
@@ -105,7 +105,7 @@
 	exit(1);
 }
 
-char *map_file(const char *name, int *sz)
+char *map_file(const char *name, size_t *sz)
 {
 	int fd;
 	void *ptr;
@@ -124,9 +124,9 @@
 	return ptr;
 }
 
-int exist(char *id, int id_len, char *ptr, int sz)
+int exist(char *id, int id_len, char *ptr, size_t sz)
 {
-	int i;
+	size_t i;
 
 	for (i = 0; i < sz; ) {
 		if (sz - i > id_len && memcmp(id, ptr + i, id_len + 1) == 0)
@@ -273,7 +273,7 @@
 {
 	char *old, *new, *id;
 	int i, fd;
-	int old_sz, new_sz;
+	size_t old_sz, new_sz;
 
 	new = map_file(new_name, &new_sz);
 	if (new == NULL)

================================================================
Index: setup/update-fstab.c
diff -u setup/update-fstab.c:1.5 setup/update-fstab.c:1.6
--- setup/update-fstab.c:1.5	Fri May 31 20:29:36 2013
+++ setup/update-fstab.c	Fri May 31 20:37:04 2013
@@ -24,8 +24,8 @@
 	char *add = ",devgid=78,devmode=0664";
 	
 	char *old;
-	int i, fd;
-	int old_sz;
+	int fd;
+	size_t i, old_sz;
 	struct stat st;
 
 	eputs("Updating /etc/fstab...");
================================================================

---- CVS-web:
    http://cvs.pld-linux.org/setup/Makefile?r1=1.36&r2=1.37
    http://cvs.pld-linux.org/setup/delpasswd.c?r1=1.4&r2=1.5
    http://cvs.pld-linux.org/setup/joinpasswd.c?r1=1.14&r2=1.15
    http://cvs.pld-linux.org/setup/update-fstab.c?r1=1.5&r2=1.6



More information about the pld-cvs-commit mailing list