commit 551440fd1dd49aea04e3f8c38d7cf8156d07124a
parent 569ec71f3b36eba30974e3c56c2fb5d1897227c8
Author: Jake Koroman <jakekoroman@gmail.com>
Date: Wed, 12 Oct 2022 15:00:33 -0400
Maintenance.
Diffstat:
2 files changed, 7 insertions(+), 5 deletions(-)
diff --git a/ascii_gen.c b/ascii_gen.c
@@ -110,10 +110,12 @@ parse_args(int argc, char **argv, Options *options)
case 'S':
{
- int size = strlen(optarg);
- options->set_size = size > 255 ? BUF_CAP : size;
+ int size = strnlen(optarg, BUF_CAP);
+
+ options->set_size = size;
options->set_type = SET_TYPE_CUSTOM;
- strncpy(options->set, optarg, BUF_CAP);
+ strncpy(options->set, optarg, size);
+ printf("sizeof input: %d\n", size);
} break;
case '?':
@@ -167,7 +169,7 @@ main(int argc, char **argv)
printf("Set : %s\n", options.set);
}
- // TODO: Maybe bundle this stuff up? including the resized stuff?
+ // TODO(jake): Maybe bundle this stuff up? including the resized stuff?
int width, height;
int channels = 1;
uint8 *image_bytes = stbi_load(options.in_file, &width, &height, NULL, channels);
diff --git a/build.sh b/build.sh
@@ -1,4 +1,4 @@
-CFLAGS='-Wall -std=c11 -pedantic -ggdb'
+CFLAGS='-Wall -pedantic -g'
LFLAGS='-lm'
set -xe