brian 96/11/03 13:09:08
Modified: support htpasswd.c
Log:
Various bugfixes, -Wall warnings.
Revision Changes Path
1.5 +4 -9 apache/support/htpasswd.c
Index: htpasswd.c
===================================================================
RCS file: /export/home/cvs/apache/support/htpasswd.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -C3 -r1.4 -r1.5
*** htpasswd.c 1996/11/03 21:02:31 1.4
--- htpasswd.c 1996/11/03 21:09:07 1.5
***************
*** 10,15 ****
--- 10,16 ----
#include <sys/signal.h>
#include <stdlib.h>
#include <time.h>
+ #include <unistd.h>
#define LF 10
#define CR 13
***************
*** 36,42 ****
if(line[x]) ++x;
y=0;
! while(line[y++] = line[x++]);
}
int getline(char *s, int n, FILE *f) {
--- 37,43 ----
if(line[x]) ++x;
y=0;
! while((line[y++] = line[x++]));
}
int getline(char *s, int n, FILE *f) {
***************
*** 68,86 ****
static unsigned char itoa64[] = /* 0 ... 63 => ascii - 64 */
"./0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";
! to64(s, v, n)
! register char *s;
! register long v;
! register int n;
! {
while (--n >= 0) {
*s++ = itoa64[v&0x3f];
v >>= 6;
}
}
- char *crypt(char *pw, char *salt); /* why aren't these prototyped in
include */
-
void add_password(char *user, FILE *f) {
char *pw, *cpw, salt[3];
--- 69,81 ----
static unsigned char itoa64[] = /* 0 ... 63 => ascii - 64 */
"./0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";
! void to64(register char *s, register long v, register int n) {
while (--n >= 0) {
*s++ = itoa64[v&0x3f];
v >>= 6;
}
}
void add_password(char *user, FILE *f) {
char *pw, *cpw, salt[3];
***************
*** 110,116 ****
exit(1);
}
! main(int argc, char *argv[]) {
FILE *tfp,*f;
char user[MAX_STRING_LEN];
char line[MAX_STRING_LEN];
--- 105,111 ----
exit(1);
}
! void main(int argc, char *argv[]) {
FILE *tfp,*f;
char user[MAX_STRING_LEN];
char line[MAX_STRING_LEN];