@@ -206,7 +206,7 @@ static void SetVariablesFromCLArgs(tesseract::TessBaseAPI* api, int argc,
206
206
char * p = strchr (opt1, ' =' );
207
207
if (!p) {
208
208
fprintf (stderr, " Missing = in configvar assignment\n " );
209
- exit (1 );
209
+ exit (EXIT_FAILURE );
210
210
}
211
211
*p = 0 ;
212
212
strncpy (opt2, strchr (argv[i + 1 ], ' =' ) + 1 , 255 );
@@ -259,7 +259,7 @@ static void FixPageSegMode(tesseract::TessBaseAPI* api,
259
259
static void checkArgValues (int arg, const char * mode, int count) {
260
260
if (arg >= count || arg < 0 ) {
261
261
printf (" Invalid %s value, please enter a number between 0-%d\n " , mode, count - 1 );
262
- exit (0 );
262
+ exit (EXIT_SUCCESS );
263
263
}
264
264
}
265
265
@@ -275,23 +275,23 @@ static void ParseArgs(const int argc, char** argv, const char** lang,
275
275
if (argc == 2 ) {
276
276
if ((strcmp (argv[1 ], " -h" ) == 0 ) || (strcmp (argv[1 ], " --help" ) == 0 )) {
277
277
PrintHelpMessage (argv[0 ]);
278
- exit (0 );
278
+ exit (EXIT_SUCCESS );
279
279
}
280
280
if (strcmp (argv[1 ], " --help-extra" ) == 0 ) {
281
281
PrintHelpExtra (argv[0 ]);
282
- exit (0 );
282
+ exit (EXIT_SUCCESS );
283
283
}
284
284
if ((strcmp (argv[1 ], " --help-psm" ) == 0 )) {
285
285
PrintHelpForPSM ();
286
- exit (0 );
286
+ exit (EXIT_SUCCESS );
287
287
}
288
288
if ((strcmp (argv[1 ], " --help-oem" ) == 0 )) {
289
289
PrintHelpForOEM ();
290
- exit (0 );
290
+ exit (EXIT_SUCCESS );
291
291
}
292
292
if ((strcmp (argv[1 ], " -v" ) == 0 ) || (strcmp (argv[1 ], " --version" ) == 0 )) {
293
293
PrintVersionInfo ();
294
- exit (0 );
294
+ exit (EXIT_SUCCESS );
295
295
}
296
296
}
297
297
@@ -338,15 +338,15 @@ static void ParseArgs(const int argc, char** argv, const char** lang,
338
338
} else {
339
339
// Unexpected argument.
340
340
fprintf (stderr, " Error, unknown command line argument '%s'\n " , argv[i]);
341
- exit (1 );
341
+ exit (EXIT_FAILURE );
342
342
}
343
343
}
344
344
345
345
*arg_i = i;
346
346
347
347
if (*outputbase == nullptr && noocr == false ) {
348
348
PrintHelpMessage (argv[0 ]);
349
- exit (1 );
349
+ exit (EXIT_FAILURE );
350
350
}
351
351
}
352
352
0 commit comments