summaryrefslogtreecommitdiff
path: root/screenshot.c
diff options
context:
space:
mode:
Diffstat (limited to 'screenshot.c')
-rw-r--r--screenshot.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/screenshot.c b/screenshot.c
index fa94c8acd..3b17028dd 100644
--- a/screenshot.c
+++ b/screenshot.c
@@ -53,7 +53,7 @@ static bool MakeBmpImage(const char *name, ScreenshotCallback *callb, void *user
{
BitmapFileHeader bfh;
BitmapInfoHeader bih;
- RgbQuad *rq = alloca(sizeof(RgbQuad) * 256);
+ RgbQuad rq[256];
byte *buff;
FILE *f;
uint i, padw;
@@ -99,7 +99,7 @@ static bool MakeBmpImage(const char *name, ScreenshotCallback *callb, void *user
// write file header and info header and palette
fwrite(&bfh, 1, sizeof(bfh), f);
fwrite(&bih, 1, sizeof(bih), f);
- fwrite(rq, 1, sizeof(RgbQuad) * 256, f);
+ fwrite(rq, 1, sizeof(rq), f);
// use by default 64k temp memory
maxlines = clamp(65536 / padw, 16, 128);
@@ -146,7 +146,7 @@ static void PNGAPI png_my_warning(png_structp png_ptr, png_const_charp message)
static bool MakePNGImage(const char *name, ScreenshotCallback *callb, void *userdata, uint w, uint h, int pixelformat, const byte *palette)
{
- png_colorp rq = alloca(sizeof(png_color) * 256);
+ png_color rq[256];
byte *buff;
FILE *f;
uint i, y, n;