Skip to content

Commit

Permalink
Use variable length array
Browse files Browse the repository at this point in the history
  • Loading branch information
tyfkda committed Dec 9, 2023
1 parent fa8f8b0 commit c9df76f
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/wcc/www/examples/aobench.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
// Floating point number example

#include <alloca.h>
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
Expand Down Expand Up @@ -225,7 +224,7 @@ void showGraphicAsText(int width, int height, unsigned char *img) {
static const char GRAYSCALE[] =
"$@B%8&WM#*oahkbdpqwmZO0QLCJUYXzcvunxrjft/\\|()1{}[]?-_+~<>i!lI;:,\"^`'. ";
const double S = (sizeof(GRAYSCALE) - 1) / 256.0;
char *line = alloca(width + 1);
char line[width + 1];
line[width] = '\0';
for (int i = 0; i < height; ++i) {
for (int j = 0; j < width; ++j) {
Expand Down

0 comments on commit c9df76f

Please sign in to comment.