[c5c522c] | 1 | --- netkit-ftp-0.17/ftp/cmds.c.longnames 2006-07-25 11:13:55.000000000 +0200 |
---|
| 2 | +++ netkit-ftp-0.17/ftp/cmds.c 2006-07-24 17:52:10.000000000 +0200 |
---|
| 3 | @@ -1057,10 +1057,9 @@ |
---|
| 4 | status(void) |
---|
| 5 | { |
---|
| 6 | int i; |
---|
| 7 | - |
---|
| 8 | - if (connected) |
---|
| 9 | + if (connected) |
---|
| 10 | printf("Connected to %s.\n", hostname); |
---|
| 11 | - else |
---|
| 12 | + else |
---|
| 13 | printf("Not connected.\n"); |
---|
| 14 | if (!proxy) { |
---|
| 15 | pswitch(1); |
---|
| 16 | @@ -1081,7 +1080,7 @@ |
---|
| 17 | onoff(runique)); |
---|
| 18 | printf("Case: %s; CR stripping: %s\n",onoff(mcase),onoff(crflag)); |
---|
| 19 | if (ntflag) { |
---|
| 20 | - printf("Ntrans: (in) %s (out) %s\n", ntin,ntout); |
---|
| 21 | + printf("Ntrans: (in) %s (out) %s\n",ntin,ntout); |
---|
| 22 | } |
---|
| 23 | else { |
---|
| 24 | printf("Ntrans: off\n"); |
---|
| 25 | @@ -1948,14 +1947,14 @@ |
---|
| 26 | } |
---|
| 27 | ntflag++; |
---|
| 28 | code = ntflag; |
---|
| 29 | - (void) strncpy(ntin, argv[1], 16); |
---|
| 30 | - ntin[16] = '\0'; |
---|
| 31 | + (void) strncpy(ntin, argv[1], NTRANS_MAX); |
---|
| 32 | + ntin[NTRANS_MAX] = '\0'; |
---|
| 33 | if (argc == 2) { |
---|
| 34 | ntout[0] = '\0'; |
---|
| 35 | return; |
---|
| 36 | } |
---|
| 37 | - (void) strncpy(ntout, argv[2], 16); |
---|
| 38 | - ntout[16] = '\0'; |
---|
| 39 | + (void) strncpy(ntout, argv[2], NTRANS_MAX); |
---|
| 40 | + ntout[NTRANS_MAX] = '\0'; |
---|
| 41 | } |
---|
| 42 | |
---|
| 43 | static char * |
---|
| 44 | @@ -1965,10 +1964,10 @@ |
---|
| 45 | char *cp1, *cp2 = new; |
---|
| 46 | register int i, ostop, found; |
---|
| 47 | |
---|
| 48 | - for (ostop = 0; *(ntout + ostop) && ostop < 16; ostop++); |
---|
| 49 | + for (ostop = 0; *(ntout + ostop) && ostop < NTRANS_MAX; ostop++); |
---|
| 50 | for (cp1 = name; *cp1; cp1++) { |
---|
| 51 | found = 0; |
---|
| 52 | - for (i = 0; *(ntin + i) && i < 16; i++) { |
---|
| 53 | + for (i = 0; *(ntin + i) && i < NTRANS_MAX; i++) { |
---|
| 54 | if (*cp1 == *(ntin + i)) { |
---|
| 55 | found++; |
---|
| 56 | if (i < ostop) { |
---|
| 57 | --- netkit-ftp-0.17/ftp/ftp.c.longnames 2006-07-25 11:13:56.000000000 +0200 |
---|
| 58 | +++ netkit-ftp-0.17/ftp/ftp.c 2006-07-24 17:46:14.000000000 +0200 |
---|
| 59 | @@ -1656,8 +1656,8 @@ |
---|
| 60 | int runqe; |
---|
| 61 | int mcse; |
---|
| 62 | int ntflg; |
---|
| 63 | - char nti[17]; |
---|
| 64 | - char nto[17]; |
---|
| 65 | + char nti[NTRANS_MAX+1]; |
---|
| 66 | + char nto[NTRANS_MAX+1]; |
---|
| 67 | int mapflg; |
---|
| 68 | char mi[MAXPATHLEN]; |
---|
| 69 | char mo[MAXPATHLEN]; |
---|
| 70 | @@ -1712,11 +1712,11 @@ |
---|
| 71 | mcase = op->mcse; |
---|
| 72 | ip->ntflg = ntflag; |
---|
| 73 | ntflag = op->ntflg; |
---|
| 74 | - (void) strncpy(ip->nti, ntin, 16); |
---|
| 75 | - (ip->nti)[16] = '\0'; /* shouldn't use strlen */ |
---|
| 76 | + (void) strncpy(ip->nti, ntin, NTRANS_MAX); |
---|
| 77 | + (ip->nti)[NTRANS_MAX] = '\0'; /* shouldn't use strlen */ |
---|
| 78 | (void) strcpy(ntin, op->nti); |
---|
| 79 | - (void) strncpy(ip->nto, ntout, 16); |
---|
| 80 | - (ip->nto)[16] = '\0'; |
---|
| 81 | + (void) strncpy(ip->nto, ntout, NTRANS_MAX); |
---|
| 82 | + (ip->nto)[NTRANS_MAX] = '\0'; |
---|
| 83 | (void) strcpy(ntout, op->nto); |
---|
| 84 | ip->mapflg = mapflag; |
---|
| 85 | mapflag = op->mapflg; |
---|
| 86 | --- netkit-ftp-0.17/ftp/ftp_var.h.longnames 2006-07-25 11:13:56.000000000 +0200 |
---|
| 87 | +++ netkit-ftp-0.17/ftp/ftp_var.h 2006-07-24 15:49:37.000000000 +0200 |
---|
| 88 | @@ -42,6 +42,7 @@ |
---|
| 89 | |
---|
| 90 | #include <setjmp.h> |
---|
| 91 | #include <sys/param.h> |
---|
| 92 | +#define NTRANS_MAX 64 |
---|
| 93 | |
---|
| 94 | /* |
---|
| 95 | * Tick counter step size. |
---|
| 96 | @@ -82,8 +83,8 @@ |
---|
| 97 | Extern char pasv[64]; /* passive port for proxy data connection */ |
---|
| 98 | Extern int passivemode; /* passive mode enabled */ |
---|
| 99 | Extern char *altarg; /* argv[1] with no shell-like preprocessing */ |
---|
| 100 | -Extern char ntin[17]; /* input translation table */ |
---|
| 101 | -Extern char ntout[17]; /* output translation table */ |
---|
| 102 | +Extern char ntin[NTRANS_MAX+1]; /* input translation table */ |
---|
| 103 | +Extern char ntout[NTRANS_MAX+1]; /* output translation table */ |
---|
| 104 | Extern char mapin[MAXPATHLEN]; /* input map template */ |
---|
| 105 | Extern char mapout[MAXPATHLEN]; /* output map template */ |
---|
| 106 | Extern char typename[32]; /* name of file transfer type */ |
---|