aboutsummaryrefslogtreecommitdiff
path: root/libpwdgrp/pwd_grp.c
diff options
context:
space:
mode:
Diffstat (limited to 'libpwdgrp/pwd_grp.c')
-rw-r--r--libpwdgrp/pwd_grp.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/libpwdgrp/pwd_grp.c b/libpwdgrp/pwd_grp.c
index e2077ade0..947f48d43 100644
--- a/libpwdgrp/pwd_grp.c
+++ b/libpwdgrp/pwd_grp.c
@@ -816,7 +816,7 @@ static int bb__parsepwent(void *data, char *line)
816 816
817 i = 0; 817 i = 0;
818 do { 818 do {
819 p = ((char *) ((struct passwd *) data)) + pw_off[i]; 819 p = (char *) data + pw_off[i];
820 820
821 if ((i & 6) ^ 2) { /* i!=2 and i!=3 */ 821 if ((i & 6) ^ 2) { /* i!=2 and i!=3 */
822 *((char **) p) = line; 822 *((char **) p) = line;
@@ -873,7 +873,7 @@ static int bb__parsegrent(void *data, char *line)
873 end_of_buf = ((struct group *) data)->gr_name; /* Evil hack! */ 873 end_of_buf = ((struct group *) data)->gr_name; /* Evil hack! */
874 i = 0; 874 i = 0;
875 do { 875 do {
876 p = ((char *) ((struct group *) data)) + gr_off[i]; 876 p = (char *) data + gr_off[i];
877 877
878 if (i < 2) { 878 if (i < 2) {
879 *((char **) p) = line; 879 *((char **) p) = line;
@@ -966,15 +966,15 @@ static const unsigned char sp_off[] ALIGN1 = {
966 offsetof(struct spwd, sp_flag) /* 8 - not a char ptr */ 966 offsetof(struct spwd, sp_flag) /* 8 - not a char ptr */
967}; 967};
968 968
969static int bb__parsespent(void *data, char * line) 969static int bb__parsespent(void *data, char *line)
970{ 970{
971 char *endptr; 971 char *endptr;
972 char *p; 972 char *p;
973 int i; 973 int i;
974 974
975 i = 0; 975 i = 0;
976 do { 976 while (1) {
977 p = ((char *) ((struct spwd *) data)) + sp_off[i]; 977 p = (char *) data + sp_off[i];
978 if (i < 2) { 978 if (i < 2) {
979 *((char **) p) = line; 979 *((char **) p) = line;
980 line = strchr(line, ':'); 980 line = strchr(line, ':');
@@ -982,10 +982,10 @@ static int bb__parsespent(void *data, char * line)
982 break; 982 break;
983 } 983 }
984 } else { 984 } else {
985 *((long *) p) = (long) strtoul(line, &endptr, 10); 985 *((long *) p) = strtoul(line, &endptr, 10);
986 986
987 if (endptr == line) { 987 if (endptr == line) {
988 *((long *) p) = ((i != 8) ? -1L : ((long)(~0UL))); 988 *((long *) p) = (i != 8) ? -1L : (long)(~0UL);
989 } 989 }
990 990
991 line = endptr; 991 line = endptr;
@@ -1003,9 +1003,9 @@ static int bb__parsespent(void *data, char * line)
1003 1003
1004 } 1004 }
1005 1005
1006 *line++ = 0; 1006 *line++ = '\0';
1007 ++i; 1007 ++i;
1008 } while (1); 1008 }
1009 1009
1010 return EINVAL; 1010 return EINVAL;
1011} 1011}