util.c (50477) | util.c (92554) |
---|---|
1/*- 2 * Copyright (c) 1988, 1993, 1994 3 * The Regents of the University of California. All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 22 unchanged lines hidden (view full) --- 31 * SUCH DAMAGE. 32 */ 33 34#ifndef lint 35#if 0 36static char sccsid[] = "@(#)util.c 8.4 (Berkeley) 4/2/94"; 37#endif 38static const char rcsid[] = | 1/*- 2 * Copyright (c) 1988, 1993, 1994 3 * The Regents of the University of California. All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 22 unchanged lines hidden (view full) --- 31 * SUCH DAMAGE. 32 */ 33 34#ifndef lint 35#if 0 36static char sccsid[] = "@(#)util.c 8.4 (Berkeley) 4/2/94"; 37#endif 38static const char rcsid[] = |
39 "$FreeBSD: head/usr.bin/chpass/util.c 50477 1999-08-28 01:08:13Z peter $"; | 39 "$FreeBSD: head/usr.bin/chpass/util.c 92554 2002-03-18 09:49:18Z cjc $"; |
40#endif /* not lint */ 41 42#include <sys/types.h> 43 44#include <ctype.h> 45#include <pwd.h> 46#include <stdio.h> 47#include <stdlib.h> --- 60 unchanged lines hidden (view full) --- 108 } 109 } 110 if (!(t = strtok((char *)NULL, " \t,")) || !isdigit(*t)) 111 goto bad; 112 day = atoi(t); 113 if (!(t = strtok((char *)NULL, " \t,")) || !isdigit(*t)) 114 goto bad; 115 year = atoi(t); | 40#endif /* not lint */ 41 42#include <sys/types.h> 43 44#include <ctype.h> 45#include <pwd.h> 46#include <stdio.h> 47#include <stdlib.h> --- 60 unchanged lines hidden (view full) --- 108 } 109 } 110 if (!(t = strtok((char *)NULL, " \t,")) || !isdigit(*t)) 111 goto bad; 112 day = atoi(t); 113 if (!(t = strtok((char *)NULL, " \t,")) || !isdigit(*t)) 114 goto bad; 115 year = atoi(t); |
116 if (day < 1 || day > 31 || month < 1 || month > 12 || !year) | 116 if (day < 1 || day > 31 || month < 1 || month > 12) |
117 goto bad; 118 /* Allow two digit years 1969-2068 */ 119 if (year < 69) 120 year += 2000; 121 else if (year < 100) 122 year += 1900; 123 if (year < 1969) 124bad: return (1); --- 29 unchanged lines hidden --- | 117 goto bad; 118 /* Allow two digit years 1969-2068 */ 119 if (year < 69) 120 year += 2000; 121 else if (year < 100) 122 year += 1900; 123 if (year < 1969) 124bad: return (1); --- 29 unchanged lines hidden --- |