Skip to content

Commit

Permalink
Use snprintf instead of sprintf
Browse files Browse the repository at this point in the history
  • Loading branch information
radarhere committed Jun 30, 2021
1 parent 5f4504b commit 518ee37
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/libImaging/Convert.c
Expand Up @@ -1595,7 +1595,7 @@ convert(
return (Imaging)ImagingError_ValueError("conversion not supported");
#else
static char buf[100];
sprintf(buf, "conversion from %.10s to %.10s not supported", imIn->mode, mode);
snprintf(buf, 100, "conversion from %.10s to %.10s not supported", imIn->mode, mode);
return (Imaging)ImagingError_ValueError(buf);
#endif
}
Expand Down Expand Up @@ -1645,8 +1645,9 @@ ImagingConvertTransparent(Imaging imIn, const char *mode, int r, int g, int b) {
#else
{
static char buf[100];
sprintf(
snprintf(
buf,
100,
"conversion from %.10s to %.10s not supported in convert_transparent",
imIn->mode,
mode);
Expand Down

0 comments on commit 518ee37

Please sign in to comment.