Skip to content

Commit 8fdeca1

Browse files
authored
Update stb_image_write.h
Provided `sizeof(buffer)` in `sptintf`
1 parent 7fd75df commit 8fdeca1

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Diff for: stb_image_write.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -773,7 +773,7 @@ static int stbi_write_hdr_core(stbi__write_context *s, int x, int y, int comp, f
773773
#ifdef __STDC_LIB_EXT1__
774774
len = sprintf_s(buffer, sizeof(buffer), "EXPOSURE= 1.0000000000000\n\n-Y %d +X %d\n", y, x);
775775
#else
776-
len = sprintf(buffer, "EXPOSURE= 1.0000000000000\n\n-Y %d +X %d\n", y, x);
776+
len = snprintf(buffer, sizeof(buffer), "EXPOSURE= 1.0000000000000\n\n-Y %d +X %d\n", y, x);
777777
#endif
778778
s->func(s->context, buffer, len);
779779

0 commit comments

Comments
 (0)