Skip to content

Commit

Permalink
correct exit code (ImageMagick/ImageMagick#6744)
Browse files Browse the repository at this point in the history
  • Loading branch information
Cristy committed Sep 28, 2023
1 parent 834a5d4 commit d730d3e
Show file tree
Hide file tree
Showing 8 changed files with 48 additions and 8 deletions.
7 changes: 6 additions & 1 deletion wand/compare.c
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,12 @@ WandExport MagickBooleanType CompareImageCommand(ImageInfo *image_info,
}
}
if (argc < 3)
return(CompareUsage());
{
(void) ThrowMagickException(exception,GetMagickModule(),OptionError,
"MissingArgument","%s","");
(void) CompareUsage();
return(MagickFalse);
}
restore_info=image_info;
channels=DefaultChannels;
difference_image=NewImageList();
Expand Down
7 changes: 6 additions & 1 deletion wand/composite.c
Original file line number Diff line number Diff line change
Expand Up @@ -445,7 +445,12 @@ WandExport MagickBooleanType CompositeImageCommand(ImageInfo *image_info,
}
}
if (argc < 4)
return(CompositeUsage());
{
(void) ThrowMagickException(exception,GetMagickModule(),OptionError,
"MissingArgument","%s","");
(void) CompositeUsage();
return(MagickFalse);
}
GetCompositeOptions(&composite_options);
filename=(char *) NULL;
format="%w,%h,%m";
Expand Down
7 changes: 6 additions & 1 deletion wand/conjure.c
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,12 @@ WandExport MagickBooleanType ConjureImageCommand(ImageInfo *image_info,
if (IsEventLogging() != MagickFalse)
(void) LogMagickEvent(TraceEvent,GetMagickModule(),"...");
if (argc < 2)
return(ConjureUsage());
{
(void) ThrowMagickException(exception,GetMagickModule(),OptionError,
"MissingArgument","%s","");
(void) ConjureUsage();
return(MagickFalse);
}
image=NewImageList();
number_images=0;
option=(char *) NULL;
Expand Down
7 changes: 6 additions & 1 deletion wand/convert.c
Original file line number Diff line number Diff line change
Expand Up @@ -541,7 +541,12 @@ WandExport MagickBooleanType ConvertImageCommand(ImageInfo *image_info,
}
}
if (argc < 3)
return(ConvertUsage());
{
(void) ThrowMagickException(exception,GetMagickModule(),OptionError,
"MissingArgument","%s","");
(void) ConvertUsage();
return(MagickFalse);
}
filename=(char *) NULL;
format="%w,%h,%m";
j=1;
Expand Down
7 changes: 6 additions & 1 deletion wand/identify.c
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,12 @@ WandExport MagickBooleanType IdentifyImageCommand(ImageInfo *image_info,
}
}
if (argc < 2)
return(IdentifyUsage());
{
(void) ThrowMagickException(exception,GetMagickModule(),OptionError,
"MissingArgument","%s","");
(void) IdentifyUsage();
return(MagickFalse);
}
count=0;
format=NULL;
j=1;
Expand Down
7 changes: 6 additions & 1 deletion wand/mogrify.c
Original file line number Diff line number Diff line change
Expand Up @@ -3864,7 +3864,12 @@ WandExport MagickBooleanType MogrifyImageCommand(ImageInfo *image_info,
}
}
if (argc < 2)
return(MogrifyUsage());
{
(void) ThrowMagickException(exception,GetMagickModule(),OptionError,
"MissingArgument","%s","");
(void) MogrifyUsage();
return(MagickFalse);
}
format=(char *) NULL;
path=(char *) NULL;
global_colormap=MagickFalse;
Expand Down
7 changes: 6 additions & 1 deletion wand/montage.c
Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,12 @@ WandExport MagickBooleanType MontageImageCommand(ImageInfo *image_info,
}
}
if (argc < 3)
return(MontageUsage());
{
(void) ThrowMagickException(exception,GetMagickModule(),OptionError,
"MissingArgument","%s","");
(void) MontageUsage();
return(MagickFalse);
}
format="%w,%h,%m";
first_scene=0;
j=1;
Expand Down
7 changes: 6 additions & 1 deletion wand/stream.c
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,12 @@ WandExport MagickBooleanType StreamImageCommand(ImageInfo *image_info,
}
}
if (argc < 3)
return(StreamUsage());
{
(void) ThrowMagickException(exception,GetMagickModule(),OptionError,
"MissingArgument","%s","");
(void) StreamUsage();
return(MagickFalse);
}
format="%w,%h,%m";
(void) format;
j=1;
Expand Down

0 comments on commit d730d3e

Please sign in to comment.