| 1 |
Description: Fix FTBFS with GCC-11 |
| 2 |
Fix a comprison error which looked like a copy-paste error. |
| 3 |
Rename a variable which was ambiguous with another c++ function. |
| 4 |
|
| 5 |
Author: Sudip Mukherjee <[email protected]> |
| 6 |
--- |
| 7 |
|
| 8 |
Bug-Debian: https://bugs.debian.org/984030 |
| 9 |
Forwarded: no |
| 10 |
|
| 11 |
--- d-itg-2.8.1-r1023.orig/src/ITGDec/ITGDecod.cpp |
| 12 |
+++ d-itg-2.8.1-r1023/src/ITGDec/ITGDecod.cpp |
| 13 |
@@ -129,7 +129,7 @@ ofstream outbin; |
| 14 |
ifstream sendlog; |
| 15 |
FILE *intxt; |
| 16 |
FILE *outtxt; |
| 17 |
|
| 18 |
+int fread_size, flagfilter, flagwinlin; |
| 19 |
unsigned int flownum; |
| 20 |
double msbitrate, msjitter, mspktloss, msdelay, mscombinedstats, secfirstline_gl; |
| 21 |
gestioneFileLog memFile[MaxNumFlow]; |
| 22 |
@@ -557,10 +557,10 @@ int main(int argc, char *argv[]) |
| 23 |
} |
| 24 |
} |
| 25 |
|
| 26 |
|
| 27 |
|
| 28 |
+ fread_size = 1; |
| 29 |
+ while (fread_size > 0) { |
| 30 |
infos = readline(&inbin, intxt, logintype); |
| 31 |
|
| 32 |
+ if (fread_size > 0) { |
| 33 |
mark(); |
| 34 |
if (flagreconstruct) { |
| 35 |
struct info *send_info = found((*infos).flowId, (*infos).srcAddr, (*infos).destAddr, (*infos).srcPort, |
| 36 |
@@ -967,7 +967,7 @@ struct info *readline(ifstream *fbin, FI |
| 37 |
if (filetype == 0) { |
| 38 |
|
| 39 |
|
| 40 |
|
| 41 |
+ fread_size = fread(infos_loc, sizeof(struct info), 1, ftxt); |
| 42 |
|
| 43 |
|
| 44 |
|
| 45 |
@@ -998,12 +998,12 @@ struct info *readline(ifstream *fbin, FI |
| 46 |
fscanf(ftxt, "Size>%5u\n", &(*infos_loc).size); |
| 47 |
if ((*infos_loc).flowId == 0) { |
| 48 |
printf("\n Error reading input file\n"); |
| 49 |
|
| 50 |
+ fread_size = 0; |
| 51 |
} else { |
| 52 |
|
| 53 |
+ fread_size = 1; |
| 54 |
} |
| 55 |
} else |
| 56 |
|
| 57 |
+ fread_size = 0; |
| 58 |
} |
| 59 |
return infos_loc; |
| 60 |
} |
| 61 |
@@ -1309,9 +1309,9 @@ void elabsplit(int flagbit, int flagjit, |
| 62 |
PRINTD(1,"Prima di leggere le info dal file %s con puntantore %p\n", |
| 63 |
memFile[i].FileName, inputfilec); |
| 64 |
|
| 65 |
|
| 66 |
+ fread_size = fread(infos, sizeof(struct info), 1, inputfilec); |
| 67 |
PRINTD(1,"Info lette dal file %s\n", memFile[i].FileName); |
| 68 |
|
| 69 |
+ if (fread_size == 0) { |
| 70 |
if (flagbit) |
| 71 |
fprintf(outfilebit, "%lf %lf\n", intclosedbit * (double) msbitrate / 1000, tempbitrate * 8 |
| 72 |
/ msbitrate); |
| 73 |
--- d-itg-2.8.1-r1023.orig/src/ITGSend/ITGSend.cpp |
| 74 |
+++ d-itg-2.8.1-r1023/src/ITGSend/ITGSend.cpp |
| 75 |
@@ -1257,7 +1257,7 @@ void *flowParser(void *param) |
| 76 |
argc -= 3; |
| 77 |
break; |
| 78 |
case 'N': |
| 79 |
|
| 80 |
+ if ((argc < 3) || (strtod(argv[h + 2], NULL) <= 0)) |
| 81 |
ReportErrorAndExit("Protocol Parser", |
| 82 |
"Invalid pkts per sec", programName, id); |
| 83 |
flows[id].IntArrivDistro = pdNormal; |
| 84 |
@@ -1392,7 +1392,7 @@ void *flowParser(void *param) |
| 85 |
argc -= 3; |
| 86 |
break; |
| 87 |
case 'n': |
| 88 |
|
| 89 |
+ if ((argc < 3) || (atoi(argv[h + 2]) <= 0)) |
| 90 |
ReportErrorAndExit("Protocol Parser", "Invalid pkt size", |
| 91 |
programName, id); |
| 92 |
delete flows[id].PktSize; |
| 93 |
--- d-itg-2.8.1-r1023.orig/src/ITGSend/traffic.cpp |
| 94 |
+++ d-itg-2.8.1-r1023/src/ITGSend/traffic.cpp |
| 95 |
@@ -412,7 +412,7 @@ void burstyParser(int &h, char *argv[], |
| 96 |
argc -= 3; |
| 97 |
break; |
| 98 |
case 'N': |
| 99 |
|
| 100 |
+ if ((argc < 5) || (strtod(argv[h + 2], NULL) <= 0)) |
| 101 |
ReportErrorAndExit("Protocol Parser", |
| 102 |
"Invalid settings for the On/Off periods", programName, flowId); |
| 103 |
b = strtod(argv[h + 1], NULL); |
| 104 |
@@ -538,7 +538,7 @@ void burstyParser(int &h, char *argv[], |
| 105 |
argc -= 3; |
| 106 |
break; |
| 107 |
case 'N': |
| 108 |
|
| 109 |
+ if ((argc < 3) || (strtod(argv[h + 2], NULL) <= 0)) |
| 110 |
ReportErrorAndExit("Protocol Parser", |
| 111 |
"Invalid settings for the Off/Off periods", programName, flowId); |
| 112 |
b = strtod(argv[h + 1], NULL); |