@@ -53,8 +53,8 @@ int main(int argc, char *argv[]) {
53
53
char cuc[] = " -u" ; // Unicode parameter
54
54
int funicode; // Unicode flag
55
55
56
- char nuc[] = " -n" ; // Non-UC SAP System parameter
57
- int fnuc; // Non-UC SAP System flag
56
+ char nuc[] = " -n" ; // Non-Unicode SAP system parameter
57
+ int fnuc; // Non-Unicode SAP system flag
58
58
59
59
unsigned char cbom1 = (unsigned char ) 0xFE ; // BOM for UTF-16: 0xFEFF
60
60
unsigned char cbom2 = (unsigned char ) 0xFF ; // ...
@@ -67,7 +67,7 @@ int main(int argc, char *argv[]) {
67
67
if (argc < 3 || argc > 4 || argv[1 ] == NULL || argv[2 ] == NULL ) {
68
68
printf (" Usage:\n %s <infile> <outfile> [-u] [-n]\n\n " , argv[0 ]);
69
69
printf (" Options:\n -u : create UTF-16 output; defaults to ASCII\n " );
70
- printf (" -n : for non-unicode SAP systems; defaults to unicode \n\n " );
70
+ printf (" -n : assume input from non-unicode SAP system \n\n " );
71
71
return 0 ;
72
72
}
73
73
@@ -105,6 +105,8 @@ int main(int argc, char *argv[]) {
105
105
fout = fopen (argv[2 ], " wb" );
106
106
if (fout == NULL ) {
107
107
printf (" Error creating output file '%s'\n " , argv[2 ]);
108
+ // Make CppCheck happy ("memory leak: bin")
109
+ // cppcheck-suppress memleak
108
110
return 2 ;
109
111
}
110
112
@@ -164,11 +166,11 @@ int main(int argc, char *argv[]) {
164
166
// The 2nd byte contains the length of the first line.
165
167
// For non-unicode SAP systems the 1st byte contains the length of the first line.
166
168
// Compute position of next length field.
167
- if (fnuc) {
168
- nextpos = (long )bout[0 ];
169
+ if (fnuc) {
170
+ nextpos = (long )bout[0 ];
169
171
}
170
- else {
171
- nextpos = ((long )bout[1 ]) * 2 + 3 ;
172
+ else {
173
+ nextpos = ((long )bout[1 ]) * 2 + 3 ;
172
174
}
173
175
174
176
for (i = 1 ; i < byte_decomp; i++) {
@@ -185,7 +187,7 @@ int main(int argc, char *argv[]) {
185
187
ret = fwrite (" \n " , 1 , 1 , fout);
186
188
187
189
// Compute position of next length field
188
- if (fnuc) {
190
+ if (fnuc) {
189
191
nextpos = nextpos + (long )bout[0 ] + 1 ;
190
192
i += 1 ;
191
193
}
0 commit comments